Skip to content

Commit

Permalink
fix: improve message
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 committed Jul 9, 2024
1 parent d89d79a commit f44e5b5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func tryLoadConfigFromDefaultPlaces() {
scope := gap.NewScope(gap.User, "glow")
dirs, err := scope.ConfigDirs()
if err != nil {
fmt.Println("Could not load find config directory.")
fmt.Println("Could not load find configuration directory.")
os.Exit(1)
}

Expand Down Expand Up @@ -425,10 +425,11 @@ func tryLoadConfigFromDefaultPlaces() {

if used := viper.ConfigFileUsed(); used != "" {
log.Debug("Using configuration file", "path", viper.ConfigFileUsed())
} else {
if err := ensureConfigFile(); err != nil {
fmt.Println("Could not create default config.")
os.Exit(1)
}
return
}

if err := ensureConfigFile(); err != nil {
fmt.Println("Could not create default configuration.")
os.Exit(1)
}
}

0 comments on commit f44e5b5

Please sign in to comment.