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

Function global_config_dir_from

atomic-config/src/lib.rs:1059–1064  ·  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

1057/// Split out so the override precedence is unit-testable without mutating
1058/// process environment (which is racy and platform-sensitive).
1059fn global_config_dir_from(env_override: Option<std::ffi::OsString>) -> Option<PathBuf> {
1060 if let Some(dir) = env_override {
1061 return Some(PathBuf::from(dir));
1062 }
1063 dirs::home_dir().map(|p| p.join(".atomic"))
1064}
1065
1066/// Get the global configuration file path
1067pub fn global_config_path() -> Option<PathBuf> {

Calls

no outgoing calls