Fixed program exiting when user in config already existed

This commit is contained in:
konrad 2017-12-19 12:02:01 +01:00 committed by kolaente
parent 41eaffba6d
commit 24ec279fd5
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 1 deletions

View File

@ -63,7 +63,10 @@ func SetEngine() (err error) {
if !exists {
_, err = CreateUser(Config.FirstUser)
if err != nil {
return err
// Janky hack, I know
if err.Error() != "this username is already taken. Please use another" {
return err
}
}
fmt.Println("Created new user " + Config.FirstUser.Username)
}