Fix compiling cargo.rs on windows
This commit is contained in:
parent
80e9188fb1
commit
62e49c5b61
1 changed files with 7 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
use std::env;
|
use std::env;
|
||||||
|
#[cfg(unix)]
|
||||||
use std::os::unix::process::CommandExt;
|
use std::os::unix::process::CommandExt;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
|
@ -81,5 +82,11 @@ fn main() {
|
||||||
_ => env::args().skip(1).collect(),
|
_ => env::args().skip(1).collect(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
Command::new("cargo").args(args).exec();
|
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),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue