Skip to content

Commit

Permalink
feat: add exit status logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed Jan 24, 2024
1 parent 97b61c3 commit 0713169
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/run_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@ pub async fn run_script(
task.abort();

if !status.success() {
std::process::exit(status.code().unwrap_or(1));
let code = status.code().unwrap_or(1);

eprintln!(
"{} {}{}",
"Exited with status".red(),
code.to_string().red().bold(),
"!".red()
);
std::process::exit(code);
}

Ok(())
Expand Down

0 comments on commit 0713169

Please sign in to comment.