Remove hyphens when auto-loading envvars from viper config (#545)
* When auto-loading envvars from toml keys, remove hyphens. See: https://unix.stackexchange.com/questions/23659/can-shell-variable-include-character
This commit is contained in:
parent
d058be25ad
commit
7e62bc4819
|
@ -186,7 +186,7 @@ func NewConfig(cfgfile string) *Config {
|
|||
viper.SetConfigFile(cfgfile)
|
||||
viper.SetEnvPrefix("matterbridge")
|
||||
viper.AddConfigPath(".")
|
||||
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
|
||||
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))
|
||||
viper.AutomaticEnv()
|
||||
f, err := os.Open(cfgfile)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue