From b6e74935f1152e5ff489b4b0bcb48104855c4b0a Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Thu, 7 Sep 2023 10:59:26 +0200 Subject: [PATCH] copy exit status of build command --- src/main.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9f20560..6317c24 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,10 +12,13 @@ fn main() { let cmd = &args[1]; println!("starting build"); - let process = Command::new(cmd).args(&args[2..]).status(); - + let exit_status = Command::new(cmd).args(&args[2..]).status(); println!("\n"); - println!("{:?}", process); let time_taken = start_time.elapsed().unwrap(); println!("Took {:?}", time_taken); + + println!("{:?}", exit_status); + if let Some(status) = exit_status.ok().and_then(|s| s.code()) { + std::process::exit(status); + } }