Skip to content

Commit

Permalink
Fix newlines in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mtibben committed Sep 13, 2021
1 parent f67a5b2 commit 9162c53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 9162c53

Please sign in to comment.