Skip to content

Commit c949de5

Browse files
committed
dbg: add more logs for cmd fail
1 parent 08c425e commit c949de5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/run/runner/helpers/setup.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ pub fn run_with_sudo(command_args: &[&str]) -> Result<()> {
2020
.args(&command_args[1..])
2121
.stdout(Stdio::piped())
2222
.output()
23-
.map_err(|_| anyhow!("Failed to execute command: {}", command_args.join(" ")))?;
23+
.map_err(|error| {
24+
anyhow!(
25+
"Failed to execute command: {} ({error:?})",
26+
command_args.join(" ")
27+
)
28+
})?;
2429

2530
if !output.status.success() {
2631
info!("stdout: {}", String::from_utf8_lossy(&output.stdout));
2732
error!("stderr: {}", String::from_utf8_lossy(&output.stderr));
33+
eprintln!("Command failed with status: {}", output.status);
2834
bail!("Failed to execute command: {}", command_args.join(" "));
2935
}
3036

0 commit comments

Comments
 (0)