From f44e5b5f5c431eaa6451aa62841659b4fdad00b3 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 9 Jul 2024 10:17:18 -0300 Subject: [PATCH] fix: improve message Signed-off-by: Carlos Alexandro Becker --- main.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 0b9dcff..f1791ec 100644 --- a/main.go +++ b/main.go @@ -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) } @@ -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) } }