added option to skip configured GIT repos (#59)

This commit is contained in:
Sean McAvoy
2018-09-03 11:51:09 -04:00
committed by Roey Darwish Dror
parent c5ea22bac3
commit bad68804ed

View File

@@ -85,6 +85,11 @@ fn run() -> Result<(), Error> {
.help("Don't perform system upgrade")
.long("no-system"),
)
.arg(
Arg::with_name("no_git_repos")
.help("Don't perform updates on configured git repos")
.long("no-git-repos"),
)
.arg(
Arg::with_name("dry_run")
.help("Print what would be done")
@@ -166,12 +171,13 @@ fn run() -> Result<(), Error> {
}
}
if let Some(custom_git_repos) = config.git_repos() {
for git_repo in custom_git_repos {
git_repos.insert(git_repo);
if !(matches.is_present("no_git_repos")) {
if let Some(custom_git_repos) = config.git_repos() {
for git_repo in custom_git_repos {
git_repos.insert(git_repo);
}
}
}
for repo in git_repos.repositories() {
report.push_result(execute(|terminal| git.pull(&repo, terminal, dry_run), &mut terminal));
}