Fix compiling cargo.rs on windows

This commit is contained in:
bjorn3 2021-06-20 13:20:51 +02:00
parent 80e9188fb1
commit 62e49c5b61

View File

@ -1,4 +1,5 @@
use std::env;
#[cfg(unix)]
use std::os::unix::process::CommandExt;
use std::path::PathBuf;
use std::process::{Command, Stdio};
@ -81,5 +82,11 @@ fn main() {
_ => env::args().skip(1).collect(),
};
#[cfg(unix)]
Command::new("cargo").args(args).exec();
#[cfg(not(unix))]
std::process::exit(
Command::new("cargo").args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1),
);
}