diff --git a/cli/create_admin.go b/cli/create_admin.go index 372b712f..03da6b08 100644 --- a/cli/create_admin.go +++ b/cli/create_admin.go @@ -8,6 +8,7 @@ import ( "fmt" "os" + "miniflux.app/logger" "miniflux.app/model" "miniflux.app/storage" ) @@ -27,6 +28,11 @@ func createAdmin(store *storage.Storage) { os.Exit(1) } + if store.UserExists(user.Username) { + logger.Info(`User %q already exists, skipping creation`, user.Username) + return + } + if err := store.CreateUser(user); err != nil { fmt.Println(err) os.Exit(1)