Skip to content

Commit

Permalink
hack: set vars to the empty string rather than removing them (this st…
Browse files Browse the repository at this point in the history
…ill exposes that they were set, though...)
  • Loading branch information
thomcc committed Nov 1, 2023
1 parent 6943d0c commit 046a492
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plrustc/plrustc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,13 @@ impl Callbacks for PlrustcCallbacks {
fn clear_env() {
let all_var_names = std::env::vars_os()
.map(|(name, _)| name)
.filter(|name| {
let name = name.to_string_lossy().to_lowercase();
!(name.starts_with("rust") || name.starts_with("plrust"))
})
.collect::<Vec<_>>();
for name in all_var_names {
std::env::remove_var(name);
std::env::set_var(name, "");
}
}

Expand Down

0 comments on commit 046a492

Please sign in to comment.