Update Flatpak (fixes #28)

This commit is contained in:
Roey Darwish Dror
2018-06-14 13:10:52 +03:00
parent 544d87d3ef
commit 7a4c5a913d
2 changed files with 15 additions and 0 deletions

View File

@@ -171,6 +171,11 @@ fn run() -> Result<(), Error> {
run_rustup(&rustup).report("rustup", &mut reports);
}
if let Ok(flatpak) = which("flatpak") {
terminal.print_separator("Flatpak");
run_flatpak(&flatpak).report("Flatpak", &mut reports);
}
let cargo_upgrade = home_path(".cargo/bin/cargo-install-update");
if cargo_upgrade.exists() {
terminal.print_separator("Cargo");

View File

@@ -152,3 +152,13 @@ pub fn run_custom_command(command: &str) -> Result<(), failure::Error> {
Ok(())
}
pub fn run_flatpak(flatpak: &PathBuf) -> Result<(), failure::Error> {
Command::new(&flatpak)
.arg("update")
.spawn()?
.wait()?
.check()?;
Ok(())
}