From c30478bf4a594084375c9e5bd766b722e2b96852 Mon Sep 17 00:00:00 2001 From: diginc Date: Tue, 1 Nov 2016 23:21:50 -0500 Subject: [PATCH] cleanup and use sentintel in is_repo --- advanced/Scripts/update.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index 7b08179d..0e36c2a2 100644 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -33,15 +33,17 @@ getGitFiles() { is_repo() { # Use git to check if directory is currently under VCS - echo -n "::: Checking $1 is a repo..." - cd "${1}" &> /dev/null || return 1 - if [[ $(git status --short) ]]; then - echo " OK!" - return 0 - else - echo " not found!" - return 1 - fi + local directory="${1}" + local gitRepo=0 + echo -n "::: Checking if ${directory} is a repo... " + cd "${directory}" &> /dev/null || return 1 + if [[ $(git status --short > /dev/null) ]]; then + echo "OK" + else + echo "not found!" + gitRepo=1 + fi; + return ${gitRepo} } make_repo() {