diff --git a/cmd/init.go b/cmd/init.go index 4cf70dde68b..1a528be4d85 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -126,14 +126,10 @@ var initCmd = &cli.Command{ } // check schema and config don't already exist - if fileExists(configFilename) { - return fmt.Errorf("%s already exists\n", configFilename) - } - if fileExists(schemaFilename) { - return fmt.Errorf("%s already exists\n", schemaFilename) - } - if fileExists(serverFilename) { - return fmt.Errorf("%s already exists\n", serverFilename) + for _, filename := range []string{configFilename, schemaFilename, serverFilename} { + if fileExists(filename) { + return fmt.Errorf("%s already exists", filename) + } } _, err := config.LoadConfigFromDefaultLocations() if err == nil { diff --git a/cmd/root.go b/cmd/root.go index 2776aa2842f..ce96c1b86d2 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -39,7 +39,7 @@ func Execute() { } if err := app.Run(os.Args); err != nil { - fmt.Fprint(os.Stderr, err.Error()) + fmt.Fprint(os.Stderr, err.Error()+"\n") os.Exit(1) } }