From 3a37312d8ee5ccc573779658d6ab0ae7b8951bf3 Mon Sep 17 00:00:00 2001 From: Yakiyo Date: Tue, 29 Aug 2023 12:07:11 +0000 Subject: [PATCH] fix: early return on flags --- cmd/root.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index 4cffde2..bcd7659 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -69,6 +69,7 @@ View community driven and simplified man pages in your terminal`, if err != nil { log.Error("Failed to clear cache", "error", err) } + return } if list := utils.Must(cmd.Flags().GetBool("list")); list { @@ -81,10 +82,11 @@ View community driven and simplified man pages in your terminal`, if !utils.FsExists(dir) { os.MkdirAll(dir, os.ModePerm) } - if err := viper.SafeWriteConfig(); err != nil { + if err := viper.WriteConfig(); err != nil { log.Fatal(err) } fmt.Println("Successfully seeded config at", where.Config()) + return } raw := utils.Must(cmd.Flags().GetBool("raw"))