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

@@ -7,6 +7,7 @@ use crate::executor::CommandExt;
use crate::executor::{Executor, ExecutorExitStatus, RunType};
use crate::terminal::{print_separator, print_warning};
use crate::utils::{require, require_option, PathExt};
use crate::Step;
use anyhow::Result;
use directories::BaseDirs;
use log::debug;
@@ -106,14 +107,14 @@ pub fn run_pkgin(ctx: &ExecutionContext) -> Result<()> {
let mut command = ctx.run_type().execute(ctx.sudo().as_ref().unwrap());
command.arg(&pkgin).arg("update");
if ctx.config().yes() {
if ctx.config().yes(Step::Pkgin) {
command.arg("-y");
}
command.check_run()?;
let mut command = ctx.run_type().execute(ctx.sudo().as_ref().unwrap());
command.arg(&pkgin).arg("upgrade");
if ctx.config().yes() {
if ctx.config().yes(Step::Pkgin) {
command.arg("-y");
}
command.check_run()