MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / global_config_dir_from

Function global_config_dir_from

atomic-config/src/lib.rs:429–434  ·  view source on GitHub ↗

Resolve the global config directory from an explicit override value. Split out so the override precedence is unit-testable without mutating process environment (which is racy and platform-sensitive).

(env_override: Option<std::ffi::OsString>)

Source from the content-addressed store, hash-verified

427/// Split out so the override precedence is unit-testable without mutating
428/// process environment (which is racy and platform-sensitive).
429fn global_config_dir_from(env_override: Option<std::ffi::OsString>) -> Option<PathBuf> {
430 if let Some(dir) = env_override {
431 return Some(PathBuf::from(dir));
432 }
433 dirs::home_dir().map(|p| p.join(".atomic"))
434}
435
436/// Get the global configuration file path
437pub fn global_config_path() -> Option<PathBuf> {

Calls

no outgoing calls