fix: if a command fails, fail the CI run

Oops.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
Lars Wirzenius
2024-01-04 14:08:56 +02:00
parent 4f8bd94e27
commit 44e5c53a31
+7 -1
View File
@@ -234,7 +234,10 @@ fn runcmd(log: &mut LogFile, argv: &[&str], cwd: &Path) -> Result<(), NativeErro
error
.to_writer(std::io::stdout())
.map_err(|e| NativeError::WriteResponse(error.clone(), e))?;
return Ok(());
return Err(NativeError::CommandFailed(
exit.code().unwrap(),
argv.iter().map(|s| s.to_string()).collect(),
));
}
Ok(())
}
@@ -499,4 +502,7 @@ enum NativeError {
#[error("failed to run command {0:?}")]
Command(Vec<String>, #[source] std::io::Error),
#[error("command failed with exit code {0}: {1:?}")]
CommandFailed(i32, Vec<String>),
}