From b9fb617214e5a4430f7d3653c9741cbfad0e5f5c Mon Sep 17 00:00:00 2001 From: steven-omaha <35634100+steven-omaha@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:42:29 +0200 Subject: [PATCH] fix(cmd): show full command on error --- crates/pacdef_core/src/cmd.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/pacdef_core/src/cmd.rs b/crates/pacdef_core/src/cmd.rs index bfaaaea..9806165 100644 --- a/crates/pacdef_core/src/cmd.rs +++ b/crates/pacdef_core/src/cmd.rs @@ -36,7 +36,9 @@ where /// 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. 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(); ensure!( success,