Skip to content

Commit

Permalink
clarified comment, adjust config location
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasticrabbit committed Oct 26, 2021
1 parent cb6c94d commit 23c5b76
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func Execute() {

func init() {
cobra.OnInitialize(initConfig)

rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.clickup.yaml)")
}

Expand All @@ -41,8 +40,8 @@ func initConfig() {
// Use config file from the flag.
viper.SetConfigFile(cfgFile)
} else {
// Search config in home/.config directory with name "clickup.yaml" (without extension).
viper.SetConfigFile(home + "/.clickup.yaml")
// Set config in home/.clickup/config.yaml
viper.SetConfigFile(home + "/.clickup/config.yaml")
}

viper.SetEnvPrefix("clickup")
Expand Down Expand Up @@ -70,6 +69,6 @@ func initConfig() {
fmt.Fprintln(os.Stderr, "auth failed")
}
viper.Set("cToken", token)
viper.WriteConfigAs(home + "/.clickup.yaml")
viper.WriteConfigAs(home + "/.clickup/config.yaml")
}
}

0 comments on commit 23c5b76

Please sign in to comment.