From bad68804ed4392c8be50f7042d1dc0c5ff2eb918 Mon Sep 17 00:00:00 2001 From: Sean McAvoy Date: Mon, 3 Sep 2018 11:51:09 -0400 Subject: [PATCH] added option to skip configured GIT repos (#59) --- src/main.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index be14a6b3..ad28de2f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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)); }