allow accepting CONDUWUIT_ prefixed config options

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-04-25 17:18:37 -04:00 committed by June
parent 894902b75f
commit 1da3048bb8

View file

@ -368,12 +368,21 @@ impl Config {
Figment::new()
.merge(Toml::file(config_file_env).nested())
.merge(Env::prefixed("CONDUIT_").global())
.merge(Env::prefixed("CONDUWUIT_").global())
} else if let Some(config_file_arg) = Env::var("CONDUWUIT_CONFIG") {
Figment::new()
.merge(Toml::file(config_file_arg).nested())
.merge(Env::prefixed("CONDUIT_").global())
.merge(Env::prefixed("CONDUWUIT_").global())
} else if let Some(config_file_arg) = path {
Figment::new()
.merge(Toml::file(config_file_arg).nested())
.merge(Env::prefixed("CONDUIT_").global())
.merge(Env::prefixed("CONDUWUIT_").global())
} else {
Figment::new().merge(Env::prefixed("CONDUIT_").global())
Figment::new()
.merge(Env::prefixed("CONDUIT_").global())
.merge(Env::prefixed("CONDUWUIT_").global())
};
let config = match raw_config.extract::<Config>() {