Add check_run()

This commit is contained in:
Roey Darwish Dror
2018-12-31 22:00:34 +02:00
parent a404df9c97
commit f3f8f322d8
11 changed files with 71 additions and 215 deletions

View File

@@ -30,12 +30,7 @@ impl NPM {
}
fn upgrade(&self, run_type: RunType) -> Result<(), Error> {
run_type
.execute(&self.command)
.args(&["update", "-g"])
.spawn()?
.wait()?
.check()?;
run_type.execute(&self.command).args(&["update", "-g"]).check_run()?;
Ok(())
}
@@ -61,12 +56,7 @@ pub fn yarn_global_update(run_type: RunType) -> Option<(&'static str, bool)> {
print_separator("Yarn");
let success = || -> Result<(), Error> {
run_type
.execute(&yarn)
.args(&["global", "upgrade", "-s"])
.spawn()?
.wait()?
.check()?;
run_type.execute(&yarn).args(&["global", "upgrade", "-s"]).check_run()?;
Ok(())
}()
.is_ok();