diff --git a/cmd/root.go b/cmd/root.go index eef7c08..cdaa907 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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.