Skip to content

Commit

Permalink
Let STDOUT and STDERR pass through
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Feb 7, 2025
1 parent a16de7a commit b85ee7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ pub(crate) trait Pipeline<P: AsRef<Path>> {
let mut cmd = self.maybe_sudo(program, sudo);
cmd.args(args);
cmd.current_dir(self.dir());
match cmd.output() {
Ok(out) => {
if !out.status.success() {
match cmd.status() {
Ok(status) => {
if !status.success() {
return Err(BuildError::Command(
format!("{:?}", cmd),
String::from_utf8_lossy(&out.stderr).to_string(),
match status.code() {
Some(code) => format!("exited with status code: {code}"),
None => "process terminated by signal".to_string(),
},
));
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/pipeline/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn run() -> Result<(), BuildError> {
Ok(_) => panic!("exit_err unexpectedly succeeded"),
Err(e) => {
assert_starts_with!(e.to_string(), "executing");
assert_ends_with!(e.to_string(), " DED: hi\n");
assert_ends_with!(e.to_string(), " exited with status code: 2");
}
}

Expand Down

0 comments on commit b85ee7e

Please sign in to comment.