Launch fwupdmgr (fix #4)

This commit is contained in:
Roey Darwish Dror
2018-06-03 16:12:16 +03:00
parent 4daac1b857
commit 8de74a64d4
2 changed files with 10 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ Just invoke `topgrade`. It will invoke the following steps:
* *Arch*: Invoke [yay](https://github.com/Jguer/yay) or fall back to pacman * *Arch*: Invoke [yay](https://github.com/Jguer/yay) or fall back to pacman
* *Redhat based*: Invoke `yum upgrade` * *Redhat based*: Invoke `yum upgrade`
* *Debian based*: Invoke `apt update && apt dist-upgrade` * *Debian based*: Invoke `apt update && apt dist-upgrade`
* *Linux*: Invoke [fwupdmgr](https://github.com/hughsie/fwupd) to show firmware upgrade. (View only. No upgrades will actually be performed)
* *Linux*: Run [needrestart](https://github.com/liske/needrestart) * *Linux*: Run [needrestart](https://github.com/liske/needrestart)
* *macOS*: Upgrade [Homebrew](https://brew.sh/) packages * *macOS*: Upgrade [Homebrew](https://brew.sh/) packages
* *macOS*: Upgrade App Store applications * *macOS*: Upgrade App Store applications

View File

@@ -193,6 +193,15 @@ fn run() -> Result<()> {
_ => (), _ => (),
} }
if let Ok(fwupdmgr) = which("fwupdmgr") {
terminal.print_separator("Firmware upgrades");
Command::new(&fwupdmgr)
.arg("refresh")
.spawn()?
.wait()?
.and_then(|| Command::new(&fwupdmgr).arg("get-updates").spawn()?.wait())?;
}
if let Ok(sudo) = &sudo { if let Ok(sudo) = &sudo {
if let Ok(needrestart) = which("needrestart") { if let Ok(needrestart) = which("needrestart") {
terminal.print_separator("Check for needed restarts"); terminal.print_separator("Check for needed restarts");