Skip to content

Commit

Permalink
Fix config flag behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
yukiyan committed Apr 27, 2017
1 parent 1f77ad2 commit 881d5aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ func init() {
func initConfig() {
if cfgFile != "" { // enable ability to specify config file via flag
viper.SetConfigFile(cfgFile)
} else {
viper.SetConfigName(".ecs-formation") // name of config file (without extension)
viper.AddConfigPath("$HOME") // adding home directory as first search path
}

viper.SetConfigName(".ecs-formation") // name of config file (without extension)
viper.AddConfigPath("$HOME") // adding home directory as first search path
viper.AutomaticEnv() // read in environment variables that match

// If a config file is found, read it in.
Expand Down

0 comments on commit 881d5aa

Please sign in to comment.