mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-19 06:15:45 +01:00
Add some QoL to run_command
This commit is contained in:
parent
f741475a3f
commit
fa92d8abe7
3 changed files with 24 additions and 18 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue