Dry run (fixes #22)

This commit is contained in:
Roey Darwish Dror
2018-08-26 16:12:59 +03:00
parent 043a2bc89f
commit 71c071d5db
10 changed files with 297 additions and 106 deletions

View File

@@ -1,14 +1,14 @@
use super::executor::Executor;
use super::terminal::Terminal;
use super::utils::Check;
use failure;
use std::process::Command;
#[must_use]
pub fn upgrade_macos(terminal: &mut Terminal) -> Option<(&'static str, bool)> {
pub fn upgrade_macos(terminal: &mut Terminal, dry_run: bool) -> Option<(&'static str, bool)> {
terminal.print_separator("App Store");
let success = || -> Result<(), failure::Error> {
Command::new("softwareupdate")
Executor::new("softwareupdate", dry_run)
.args(&["--install", "--all"])
.spawn()?
.wait()?