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

Method set_path

crates/openshell-core/src/forward.rs:949–955  ·  view source on GitHub ↗

Tests serialize process-wide environment changes with ENV_LOCK.

(key: &'static str, value: &std::path::Path)

Source from the content-addressed store, hash-verified

947 impl EnvVarGuard {
948 #[allow(unsafe_code)] // Tests serialize process-wide environment changes with ENV_LOCK.
949 fn set_path(key: &'static str, value: &std::path::Path) -> Self {
950 let previous = std::env::var_os(key);
951 unsafe {
952 std::env::set_var(key, value);
953 }
954 Self { key, previous }
955 }
956 }
957
958 #[allow(unsafe_code)] // Tests serialize process-wide environment changes with ENV_LOCK.

Calls

no outgoing calls