Skip to content

Commit 62e49c5

Browse files
committed
Fix compiling cargo.rs on windows
1 parent 80e9188 commit 62e49c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/cargo.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::env;
2+
#[cfg(unix)]
23
use std::os::unix::process::CommandExt;
34
use std::path::PathBuf;
45
use std::process::{Command, Stdio};
@@ -81,5 +82,11 @@ fn main() {
8182
_ => env::args().skip(1).collect(),
8283
};
8384

85+
#[cfg(unix)]
8486
Command::new("cargo").args(args).exec();
87+
88+
#[cfg(not(unix))]
89+
std::process::exit(
90+
Command::new("cargo").args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1),
91+
);
8592
}

0 commit comments

Comments
 (0)