Add a flag to disable showing Arch Linux news (fix #786)

This commit is contained in:
Roey Darwish Dror
2021-10-29 09:53:30 +03:00
parent f235c56b82
commit 0467bd4dde
3 changed files with 19 additions and 5 deletions

View File

@@ -25,11 +25,13 @@ pub struct YayParu {
impl ArchPackageManager for YayParu {
fn upgrade(&self, ctx: &ExecutionContext) -> Result<()> {
Command::new(&self.executable)
.arg("-Pw")
.spawn()
.and_then(|mut p| p.wait())
.ok();
if ctx.config().show_arch_news() {
Command::new(&self.executable)
.arg("-Pw")
.spawn()
.and_then(|mut p| p.wait())
.ok();
}
let mut command = ctx.run_type().execute(&self.executable);