From cd2b686a7e14dab793d6628786f507592fffc505 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Mon, 29 Oct 2018 13:47:52 +0800 Subject: [PATCH] When auto-loading envvars from toml keys, remove hyphens. See: https://unix.stackexchange.com/questions/23659/can-shell-variable-include-character --- bridge/config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridge/config/config.go b/bridge/config/config.go index 7f8fc3ee..71aed211 100644 --- a/bridge/config/config.go +++ b/bridge/config/config.go @@ -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 {