mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-10-29 07:23:25 +08:00
* refactor(runtime): confine and reduce unsafe code Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(ci): make signal probe portable and gate Linux initialization Signed-off-by: Drew Newberry <anewberry@nvidia.com> * fix(cli): handle platform-specific SSH cancellation lints Signed-off-by: Drew Newberry <anewberry@nvidia.com> --------- Signed-off-by: Drew Newberry <anewberry@nvidia.com>
20 lines
622 B
Rust
20 lines
622 B
Rust
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
use std::path::{Path, PathBuf};
|
|
|
|
#[path = "../../../tests/support/environment.rs"]
|
|
mod environment;
|
|
pub use environment::Environment;
|
|
|
|
pub fn with_tmp_xdg(tmp: &Path, f: impl FnOnce(&Path)) {
|
|
with_tmp_xdg_env(tmp, Environment::new(), f);
|
|
}
|
|
|
|
pub fn with_tmp_xdg_env(tmp: &Path, env: Environment, f: impl FnOnce(&Path)) {
|
|
env.set("XDG_CONFIG_HOME", tmp).run(|| {
|
|
let root = PathBuf::from(std::env::var_os("XDG_CONFIG_HOME").unwrap());
|
|
f(&root);
|
|
});
|
|
}
|