🔒️ Move away from std::env::set_var, which is unsound
This commit is contained in:
parent
fb1a832916
commit
c84857ae9b
4 changed files with 12 additions and 6 deletions
|
|
@ -27,7 +27,7 @@ impl ProcessHandler {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn run(self, executable: impl ToString, args: Vec<String>) {
|
||||
pub fn run(self, executable: impl ToString, args: Vec<String>, vars: Vec<(String, String)>) {
|
||||
let executable = executable.to_string();
|
||||
tokio::spawn(async move {
|
||||
let mut child = match Command::new(&executable)
|
||||
|
|
@ -35,6 +35,7 @@ impl ProcessHandler {
|
|||
.stdin(Stdio::null())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
.envs(vars)
|
||||
.kill_on_drop(true)
|
||||
.spawn()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue