Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleygwilliams authored Jul 29, 2019
2 parents ef5430f + 06a29a4 commit cb9e5fe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/settings/global_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ fn get_global_config() -> Result<GlobalUser, failure::Error> {
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<GlobalUser, config::ConfigError> = s.try_into();
Expand Down

0 comments on commit cb9e5fe

Please sign in to comment.