Selective yes (fix #802) (#808)

* Selective yes flag (fix #802)

* Selective yes flag (fix #802)

* selective yes

* MacOS
This commit is contained in:
Roey Darwish Dror
2021-12-06 14:44:20 +02:00
committed by GitHub
parent 4b8cf641a1
commit ab3ff0ecae
11 changed files with 77 additions and 59 deletions

View File

@@ -1,7 +1,7 @@
use crate::execution_context::ExecutionContext;
use crate::executor::RunType;
use crate::terminal::{print_separator, prompt_yesno};
use crate::{error::TopgradeError, utils::require};
use crate::{error::TopgradeError, utils::require, Step};
use anyhow::Result;
use log::debug;
use std::process::Command;
@@ -42,7 +42,7 @@ pub fn run_silnite(ctx: &ExecutionContext) -> Result<()> {
pub fn upgrade_macos(ctx: &ExecutionContext) -> Result<()> {
print_separator("macOS system update");
let should_ask = !(ctx.config().yes()) || (ctx.config().dry_run());
let should_ask = !(ctx.config().yes(Step::System)) || (ctx.config().dry_run());
if should_ask {
println!("Finding available software");
if system_update_available()? {