MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / xdg_config_dir

Function xdg_config_dir

crates/openshell-core/src/paths.rs:19–27  ·  view source on GitHub ↗

Resolve the XDG config base directory. Returns `$XDG_CONFIG_HOME` if set, otherwise `$HOME/.config`.

()

Source from the content-addressed store, hash-verified

17///
18/// Returns `$XDG_CONFIG_HOME` if set, otherwise `$HOME/.config`.
19pub fn xdg_config_dir() -> Result<PathBuf> {
20 if let Ok(path) = std::env::var("XDG_CONFIG_HOME") {
21 return Ok(PathBuf::from(path));
22 }
23 let home = std::env::var("HOME")
24 .into_diagnostic()
25 .wrap_err("HOME is not set")?;
26 Ok(PathBuf::from(home).join(".config"))
27}
28
29/// The top-level `OpenShell` config directory: `$XDG_CONFIG_HOME/openshell/`.
30pub fn openshell_config_dir() -> Result<PathBuf> {

Callers 4

openshell_config_dirFunction · 0.70
forward_pid_dirFunction · 0.70
gateway_mtls_dirFunction · 0.50

Calls

no outgoing calls

Tested by 1