fix(cmd): show full command on error

This commit is contained in:
steven-omaha
2024-04-06 18:42:29 +02:00
parent 675b06352d
commit b9fb617214
+3 -1
View File
@@ -36,7 +36,9 @@ where
/// This function will return an error if the command cannot be run or if it returns a non-zero /// This function will return an error if the command cannot be run or if it returns a non-zero
/// exit status. In case of an error the full command will be part of the error message. /// exit status. In case of an error the full command will be part of the error message.
pub fn run_external_command(mut cmd: Command) -> Result<()> { pub fn run_external_command(mut cmd: Command) -> Result<()> {
let exit_status = cmd.status().with_context(|| "running command [{cmd:?}]")?; let exit_status = cmd
.status()
.with_context(|| format!("running command [{cmd:?}]"))?;
let success = exit_status.success(); let success = exit_status.success();
ensure!( ensure!(
success, success,