Fix a bug with status_checked_with_codes (#202)
This commit is contained in:
committed by
Thomas Schönauer
parent
c4091584c3
commit
582bc737cb
@@ -179,15 +179,12 @@ impl Executor {
|
||||
#[cfg_attr(windows, allow(dead_code))]
|
||||
pub fn status_checked_with_codes(&mut self, codes: &[i32]) -> Result<()> {
|
||||
match self {
|
||||
Executor::Wet(c) => c.status_checked_with(|status| match status.code() {
|
||||
Some(code) => {
|
||||
if codes.contains(&code) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(())
|
||||
}
|
||||
Executor::Wet(c) => c.status_checked_with(|status| {
|
||||
if status.success() || status.code().as_ref().map(|c| codes.contains(c)).unwrap_or(false) {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(())
|
||||
}
|
||||
None => Err(()),
|
||||
}),
|
||||
Executor::Dry(c) => {
|
||||
c.dry_run();
|
||||
|
||||
Reference in New Issue
Block a user