Skip to content

Commit

Permalink
feat(command): log the output of failed external commands
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Oct 19, 2023
1 parent be87608 commit 205cdbb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions git-cliff-core/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ pub fn run(
if output.status.success() {
Ok(str::from_utf8(&output.stdout)?.to_string())
} else {
for output in [output.stdout, output.stderr] {
let output = str::from_utf8(&output)?.to_string();
if !output.is_empty() {
log::error!("{}", output);
}
}
Err(IoError::new(
IoErrorKind::Other,
format!("command exited with {:?}", output.status),
Expand Down

0 comments on commit 205cdbb

Please sign in to comment.