fix(config): Merge custom config over repo config

Custom config, like args, is more mutable, so it should be respected
more.
This commit is contained in:
Ed Page 2021-01-04 16:16:01 -06:00
parent 5db9a8e1c9
commit ecb32a674a

View file

@ -217,13 +217,13 @@ fn init_logging(level: Option<log::Level>) {
fn load_config(cwd: &std::path::Path, args: &args::Args) -> Result<config::Config, anyhow::Error> { fn load_config(cwd: &std::path::Path, args: &args::Args) -> Result<config::Config, anyhow::Error> {
let mut config = config::Config::default(); let mut config = config::Config::default();
if let Some(path) = args.custom_config.as_ref() {
config.update(&config::Config::from_file(path)?);
}
if !args.isolated { if !args.isolated {
let derived = config::Config::derive(cwd)?; let derived = config::Config::derive(cwd)?;
config.update(&derived); config.update(&derived);
} }
if let Some(path) = args.custom_config.as_ref() {
config.update(&config::Config::from_file(path)?);
}
config.update(&args.config); config.update(&args.config);
config.default.update(&args.overrides); config.default.update(&args.overrides);