This commit is contained in:
Christo De Lange 2017-04-20 07:30:24 +00:00 committed by GitHub
commit 83af8d167b

View file

@ -57,13 +57,14 @@ func init() {
// Read in config file and ENV variables if set.
func initConfig() {
viper.SetConfigName(".cobra") // name of config file (without extension)
viper.AddConfigPath("$HOME") // adding home directory as first search path
if cfgFile != "" { // enable ability to specify config file via flag
viper.SetConfigFile(cfgFile)
}
viper.SetConfigName(".cobra") // name of config file (without extension)
viper.AddConfigPath("$HOME") // adding home directory as first search path
viper.AutomaticEnv() // read in environment variables that match
viper.AutomaticEnv() // read in environment variables that match
// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {