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

Function with_tmp_xdg

crates/openshell-cli/src/run.rs:7918–7928  ·  view source on GitHub ↗
(tmp: &Path, f: F)

Source from the content-addressed store, hash-verified

7916 }
7917
7918 fn with_tmp_xdg<F: FnOnce()>(tmp: &Path, f: F) {
7919 let _guard = TEST_ENV_LOCK
7920 .lock()
7921 .unwrap_or_else(std::sync::PoisonError::into_inner);
7922 let guard = EnvVarGuard::set(
7923 "XDG_CONFIG_HOME",
7924 tmp.to_str().expect("temp path should be utf-8"),
7925 );
7926 f();
7927 drop(guard);
7928 }
7929 fn with_tmp_xdg_and_system<F: FnOnce()>(tmp: &Path, system: &Path, f: F) {
7930 let _guard = TEST_ENV_LOCK
7931 .lock()

Calls

no outgoing calls