Skip to content

Commit

Permalink
Merge pull request #99 from pborzenkov/env-vars
Browse files Browse the repository at this point in the history
cmd: allow to customize nested options via env variables
  • Loading branch information
sdurrheimer authored Nov 7, 2018
2 parents b01d2b5 + 94a5b5e commit bdf59b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/promu.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ func initConfig() error {
viper.SetConfigName(".promu") // name of config file (without extension)
viper.AddConfigPath(".") // look for config in the working directory
viper.SetEnvPrefix("promu")
viper.AutomaticEnv() // read in environment variables that match
viper.AutomaticEnv() // read in environment variables that match
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) // replacing dots in key names with '_'

// If a config file is found, read it in.
if err := viper.ReadInConfig(); err != nil {
Expand Down

0 comments on commit bdf59b4

Please sign in to comment.