Skip to content

Commit

Permalink
fix: early return on flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Yakiyo committed Aug 29, 2023
1 parent b900c4f commit 3a37312
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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"))
Expand Down

0 comments on commit 3a37312

Please # to comment.