1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-09-17 10:17:07 +03:00

feat(command): log the output of failed external commands

This commit is contained in:
Orhun Parmaksız 2023-10-19 15:57:18 +03:00
parent be87608002
commit 205cdbb391
No known key found for this signature in database
GPG Key ID: F83424824B3E4B90

View File

@ -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),