* Selective yes flag (fix #802) * Selective yes flag (fix #802) * selective yes * MacOS
This commit is contained in:
committed by
GitHub
parent
4b8cf641a1
commit
ab3ff0ecae
@@ -393,9 +393,9 @@ pub struct CommandLineArgs {
|
||||
#[structopt(short = "k", long = "keep")]
|
||||
keep_at_end: bool,
|
||||
|
||||
/// Say yes to package manager's prompt (experimental)
|
||||
/// Say yes to package manager's prompt
|
||||
#[structopt(short = "y", long = "yes")]
|
||||
yes: bool,
|
||||
yes: Option<Vec<Step>>,
|
||||
|
||||
/// Don't pull the predefined git repos
|
||||
#[structopt(long = "disable-predefined-git-repos")]
|
||||
@@ -585,8 +585,20 @@ impl Config {
|
||||
|
||||
/// Whether to say yes to package managers
|
||||
#[allow(dead_code)]
|
||||
pub fn yes(&self) -> bool {
|
||||
self.config_file.assume_yes.unwrap_or(self.opt.yes)
|
||||
pub fn yes(&self, step: Step) -> bool {
|
||||
if let Some(yes) = self.config_file.assume_yes {
|
||||
return yes;
|
||||
}
|
||||
|
||||
if let Some(yes_list) = &self.opt.yes {
|
||||
if yes_list.is_empty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
return yes_list.contains(&step);
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
/// Bash-it branch
|
||||
|
||||
Reference in New Issue
Block a user