From 60d37dfc412e827734b0bbe7caaff31f27675c3d Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Wed, 22 Oct 2025 16:40:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(cli):=20load=20config=20file?= =?UTF-8?q?=20as=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the config file should not be required - set required to false --- src/cli/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cli/main.rs b/src/cli/main.rs index 3d18f90..945354e 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -428,15 +428,16 @@ fn get_config() -> Result<(Config, ClientConfig)> { let path = home_dir.join(".cull-gmail/cull-gmail.toml"); log::info!("Loading config from {}", path.display()); + let config_file = config::File::with_name(path.to_path_buf().to_str().unwrap()); + let config_file = config_file.required(false); + let configurations = config::Config::builder() .set_default("credential_file", "credential.json")? .set_default("config_root", "h:.cull-gmail")? .set_default("rules", "rules.toml")? .set_default("execute", true)? .set_default("token_cache_env", "CULL_GMAIL_TOKEN_CACHE")? - .add_source(config::File::with_name( - path.to_path_buf().to_str().unwrap(), - )) + .add_source(config_file) .add_source(config::Environment::with_prefix("APP")) .build()?;