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

@@ -15,9 +15,7 @@ pub fn upgrade_freebsd(sudo: &Option<PathBuf>, run_type: RunType) -> Option<(&'s
run_type
.execute(sudo)
.args(&["/usr/sbin/freebsd-update", "fetch", "install"])
.spawn()?
.wait()?
.check()?;
.check_run()?;
Ok(())
}()
.is_ok();
@@ -35,12 +33,7 @@ pub fn upgrade_packages(sudo: &Option<PathBuf>, run_type: RunType) -> Option<(&'
if let Some(sudo) = sudo {
let success = || -> Result<(), Error> {
run_type
.execute(sudo)
.args(&["/usr/sbin/pkg", "upgrade"])
.spawn()?
.wait()?
.check()?;
run_type.execute(sudo).args(&["/usr/sbin/pkg", "upgrade"]).check_run()?;
Ok(())
}()
.is_ok();