Skip to content

Commit

Permalink
Try keeping original PATH in make clean-all
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Oct 20, 2023
1 parent 457a2bc commit 603c907
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions worker/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ fn main() {
// Force forward slashes on Windows too so that is plays well with our dumb `Makefile`.
let mediasoup_out_dir = format!("{}/out", out_dir.replace('\\', "/"));

// Store original PATH so we make `make clean-all` use it, otherwise
// our modified PATH may include rm.exe in Windows and delete itself.
let original_path = env::var("PATH").unwrap();

// Add C++ std lib
#[cfg(target_os = "linux")]
{
Expand Down Expand Up @@ -172,6 +176,7 @@ fn main() {
// Clean
if !Command::new("make")
.arg("clean-all")
.env("PATH", original_path)
.env("MEDIASOUP_OUT_DIR", &mediasoup_out_dir)
.spawn()
.expect("Failed to start")
Expand Down

0 comments on commit 603c907

Please sign in to comment.