Skip to content

Commit

Permalink
Merge pull request #123 from yukiyan/fix-config-flag-behavior
Browse files Browse the repository at this point in the history
Fix config flag behavior
  • Loading branch information
stormcat24 authored Apr 27, 2017
2 parents 1f77ad2 + 881d5aa commit f62c215
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 f62c215

Please sign in to comment.