This commit is contained in:
Roey Darwish Dror
2020-06-10 11:51:52 +03:00
committed by GitHub
parent 05612b51f2
commit ddd10981b4
4 changed files with 177 additions and 0 deletions

View File

@@ -76,6 +76,7 @@ pub enum Step {
Tldr,
Wsl,
Tmux,
Vagrant,
}
#[derive(Deserialize, Default, Debug)]
@@ -86,6 +87,12 @@ pub struct Git {
pull_predefined: Option<bool>,
}
#[derive(Deserialize, Default, Debug)]
pub struct Vagrant {
directories: Option<Vec<String>>,
power_on: Option<bool>,
}
#[derive(Deserialize, Default, Debug)]
pub struct Windows {
accept_all_updates: Option<bool>,
@@ -136,6 +143,7 @@ pub struct ConfigFile {
linux: Option<Linux>,
git: Option<Git>,
windows: Option<Windows>,
vagrant: Option<Vagrant>,
}
impl ConfigFile {
@@ -487,6 +495,19 @@ impl Config {
self.config_file.git.as_ref().and_then(|git| git.max_concurrency)
}
/// Should we power on vagrant boxes if needed
pub fn vagrant_power_on(&self) -> Option<bool> {
self.config_file.vagrant.as_ref().and_then(|vagrant| vagrant.power_on)
}
/// Vagrant directories
pub fn vagrant_directories(&self) -> Option<&Vec<String>> {
self.config_file
.vagrant
.as_ref()
.and_then(|vagrant| vagrant.directories.as_ref())
}
/// Extra yay arguments
#[allow(dead_code)]
pub fn enable_tlmgr_linux(&self) -> bool {