diff --git a/src/settings/global_user.rs b/src/settings/global_user.rs index 3383a586c..35b5205d0 100644 --- a/src/settings/global_user.rs +++ b/src/settings/global_user.rs @@ -24,9 +24,15 @@ fn get_global_config() -> Result { let config_str = config_path .to_str() .expect("global config path should be a string"); - s.merge(File::with_name(config_str))?; - // Eg.. `CF_ACCOUNT_AUTH_KEY=farts` would set the `account_auth_key` key + // Skip reading global config if non existent + // because envs might be provided + if config_path.exists() { + s.merge(File::with_name(config_str))?; + } + + // Eg.. `CF_API_KEY=farts` would set the `account_auth_key` key + // envs are: CF_API_KEY and CF_EMAIL s.merge(Environment::with_prefix("CF"))?; let global_user: Result = s.try_into();