Handle Redhat and Debian systems

This commit is contained in:
Roey Darwish Dror
2018-06-01 14:43:16 +03:00
parent f2c9050d01
commit f6024c275d
2 changed files with 30 additions and 0 deletions

View File

@@ -156,6 +156,34 @@ fn run() -> Result<()> {
}
}
}
OSType::CentOS | OSType::Redhat => {
if let Ok(sudo) = &sudo {
Command::new(&sudo)
.arg("yum")
.arg("upgrade")
.spawn()?
.wait()?;
}
}
OSType::Ubuntu | OSType::Debian => {
if let Ok(sudo) = &sudo {
Command::new(&sudo)
.arg("apt")
.arg("update")
.spawn()?
.wait()?
.and_then(|| {
Command::new(&sudo)
.arg("apt")
.arg("dist-upgrade")
.spawn()?
.wait()
})?;
}
}
_ => (),
}