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

Function with_tmp_xdg_and_system

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

Source from the content-addressed store, hash-verified

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()
7932 .unwrap_or_else(std::sync::PoisonError::into_inner);
7933 let xdg_guard = EnvVarGuard::set(
7934 "XDG_CONFIG_HOME",
7935 tmp.to_str().expect("temp path should be utf-8"),
7936 );
7937 let system_guard = EnvVarGuard::set(
7938 "OPENSHELL_SYSTEM_GATEWAY_DIR",
7939 system.to_str().expect("system path should be utf-8"),
7940 );
7941 f();
7942 drop(system_guard);
7943 drop(xdg_guard);
7944 }
7945
7946 fn edge_registration(name: &str, endpoint: &str) -> GatewayMetadata {
7947 GatewayMetadata {

Calls

no outgoing calls