Add a flag to disable the predefined git repositories (fix #305)
This commit is contained in:
@@ -4,6 +4,9 @@
|
|||||||
# "~/.config/something"
|
# "~/.config/something"
|
||||||
#]
|
#]
|
||||||
|
|
||||||
|
# Don't pull the predefined git repos
|
||||||
|
# predefined_git_repos = false
|
||||||
|
|
||||||
# Disable specific steps - same options as the command line flag
|
# Disable specific steps - same options as the command line flag
|
||||||
#disable = ["system", "emacs"]
|
#disable = ["system", "emacs"]
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ pub struct ConfigFile {
|
|||||||
pre_commands: Option<Commands>,
|
pre_commands: Option<Commands>,
|
||||||
commands: Option<Commands>,
|
commands: Option<Commands>,
|
||||||
git_repos: Option<Vec<String>>,
|
git_repos: Option<Vec<String>>,
|
||||||
|
predefined_git_repos: Option<bool>,
|
||||||
disable: Option<Vec<Step>>,
|
disable: Option<Vec<Step>>,
|
||||||
remote_topgrades: Option<Vec<String>>,
|
remote_topgrades: Option<Vec<String>>,
|
||||||
ssh_arguments: Option<String>,
|
ssh_arguments: Option<String>,
|
||||||
@@ -189,6 +190,10 @@ pub struct CommandLineArgs {
|
|||||||
/// Say yes to package manager's prompt (experimental)
|
/// Say yes to package manager's prompt (experimental)
|
||||||
#[structopt(short = "y", long = "yes")]
|
#[structopt(short = "y", long = "yes")]
|
||||||
yes: bool,
|
yes: bool,
|
||||||
|
|
||||||
|
/// Disable predefined_git_repos
|
||||||
|
#[structopt(long = "disable-predefined-git-repos")]
|
||||||
|
disable_predefined_git_repos: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CommandLineArgs {
|
impl CommandLineArgs {
|
||||||
@@ -349,4 +354,8 @@ impl Config {
|
|||||||
None => "--devel",
|
None => "--devel",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn use_predefined_git_repos(&self) -> bool {
|
||||||
|
!self.opt.disable_predefined_git_repos && self.config_file.predefined_git_repos.unwrap_or(true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,6 +233,8 @@ fn run() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let emacs = emacs::Emacs::new(&base_dirs);
|
let emacs = emacs::Emacs::new(&base_dirs);
|
||||||
|
if config.use_predefined_git_repos()
|
||||||
|
{
|
||||||
if config.should_run(Step::Emacs) {
|
if config.should_run(Step::Emacs) {
|
||||||
if let Some(directory) = emacs.directory() {
|
if let Some(directory) = emacs.directory() {
|
||||||
git_repos.insert(directory);
|
git_repos.insert(directory);
|
||||||
@@ -266,6 +268,7 @@ fn run() -> Result<()> {
|
|||||||
if let Some(profile) = powershell.profile() {
|
if let Some(profile) = powershell.profile() {
|
||||||
git_repos.insert(profile);
|
git_repos.insert(profile);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if config.should_run(Step::GitRepos) {
|
if config.should_run(Step::GitRepos) {
|
||||||
if let Some(custom_git_repos) = config.git_repos() {
|
if let Some(custom_git_repos) = config.git_repos() {
|
||||||
|
|||||||
Reference in New Issue
Block a user