Rename Supress variant
This commit is contained in:
parent
17011d02ea
commit
03d48dd735
2 changed files with 9 additions and 5 deletions
|
|
@ -937,14 +937,18 @@ impl Build {
|
|||
|
||||
/// Runs a command, printing out nice contextual information if it fails.
|
||||
fn run_quiet(&self, cmd: &mut Command) {
|
||||
self.run_cmd(BootstrapCommand::from(cmd).fail_fast().output_mode(OutputMode::Suppress));
|
||||
self.run_cmd(
|
||||
BootstrapCommand::from(cmd).fail_fast().output_mode(OutputMode::SuppressOnSuccess),
|
||||
);
|
||||
}
|
||||
|
||||
/// Runs a command, printing out nice contextual information if it fails.
|
||||
/// Exits if the command failed to execute at all, otherwise returns its
|
||||
/// `status.success()`.
|
||||
fn run_quiet_delaying_failure(&self, cmd: &mut Command) -> bool {
|
||||
self.run_cmd(BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::Suppress))
|
||||
self.run_cmd(
|
||||
BootstrapCommand::from(cmd).delay_failure().output_mode(OutputMode::SuppressOnSuccess),
|
||||
)
|
||||
}
|
||||
|
||||
/// A centralized function for running commands that do not return output.
|
||||
|
|
@ -965,7 +969,7 @@ impl Build {
|
|||
}),
|
||||
matches!(mode, OutputMode::PrintAll),
|
||||
),
|
||||
OutputMode::Suppress => (command.command.output(), true),
|
||||
OutputMode::SuppressOnSuccess => (command.command.output(), true),
|
||||
};
|
||||
|
||||
let output = match output {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ pub enum OutputMode {
|
|||
/// Print the output (by inheriting stdout/stderr).
|
||||
PrintOutput,
|
||||
/// Suppress the output if the command succeeds, otherwise print the output.
|
||||
Suppress,
|
||||
SuppressOnSuccess,
|
||||
}
|
||||
|
||||
/// Wrapper around `std::process::Command`.
|
||||
|
|
@ -43,6 +43,6 @@ impl<'a> BootstrapCommand<'a> {
|
|||
|
||||
impl<'a> From<&'a mut Command> for BootstrapCommand<'a> {
|
||||
fn from(command: &'a mut Command) -> Self {
|
||||
Self { command, failure_behavior: None, output_mode: OutputMode::Suppress }
|
||||
Self { command, failure_behavior: None, output_mode: OutputMode::SuppressOnSuccess }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue