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,14 +1,16 @@
use crate::execution_context::ExecutionContext;
use crate::executor::CommandExt;
use crate::terminal::print_separator;
use crate::{error::SkipStep, utils};
use anyhow::Result;
use log::{debug, error};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::{fmt::Display, rc::Rc, str::FromStr};
use anyhow::Result;
use log::{debug, error};
use strum::EnumString;
use crate::execution_context::ExecutionContext;
use crate::executor::CommandExt;
use crate::terminal::print_separator;
use crate::{error::SkipStep, utils, Step};
#[derive(Debug, Copy, Clone, EnumString)]
#[strum(serialize_all = "lowercase")]
enum BoxStatus {
@@ -188,7 +190,7 @@ pub fn topgrade_vagrant_box(ctx: &ExecutionContext, vagrant_box: &VagrantBox) ->
print_separator(seperator);
}
let mut command = format!("env TOPGRADE_PREFIX={} topgrade", vagrant_box.smart_name());
if ctx.config().yes() {
if ctx.config().yes(Step::Vagrant) {
command.push_str(" -y");
}