From fa92d8abe7810c8a32a37be49f162b795c226f4d Mon Sep 17 00:00:00 2001 From: datdenkikniet Date: Sat, 15 Apr 2023 00:09:50 +0200 Subject: Add some QoL to run_command --- xtask/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xtask/src/main.rs') diff --git a/xtask/src/main.rs b/xtask/src/main.rs index a7fd1d3..30608b9 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -44,6 +44,7 @@ const DEFAULT_FEATURES: &str = "test-critical-section"; #[derive(Debug, Clone)] pub struct RunResult { exit_status: ExitStatus, + full_command: String, stdout: String, stderr: String, } @@ -329,9 +330,12 @@ fn command_parser(command: &CargoCommand, overwrite: bool) -> anyhow::Result<()> | CargoCommand::Book { .. } | CargoCommand::ExampleSize { .. } => { let cargo_result = run_command(command)?; + let command = cargo_result.full_command; if let Some(exit_code) = cargo_result.exit_status.code() { if exit_code != exitcode::OK { - error!("Exit code from command: {exit_code}"); + error!("Command {command} failed."); + error!("Exit code: {exit_code}"); + if !cargo_result.stdout.is_empty() { info!("{}", cargo_result.stdout); } -- cgit v1.2.3