Skip to content

Commit

Permalink
Print stderr if spawned subcommand fails
Browse files Browse the repository at this point in the history
Fix bug where stdout was printed instead of stderr if a spawned
subcommand failed.
  • Loading branch information
MarkusPettersson98 committed Aug 30, 2024
1 parent 6274589 commit c9be17a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wireguard-go-rs/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ fn exec(mut command: impl BorrowMut<Command>) -> anyhow::Result<String> {
let stdout = str::from_utf8(&output.stdout).unwrap_or("Invalid UTF-8");

if !output.status.success() {
let stderr = str::from_utf8(&output.stdout).unwrap_or("Invalid UTF-8");
let stderr = str::from_utf8(&output.stderr).unwrap_or("Invalid UTF-8");

eprintln!("Error from {command:?}");
eprintln!();
Expand Down

0 comments on commit c9be17a

Please sign in to comment.