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:
Patrick Connolly
2018-10-29 13:47:52 +08:00
parent 3b8837a16b
commit cd2b686a7e

View File

@@ -185,7 +185,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 {