From: Hugo Villeneuve Date: Fri, 5 Jul 2019 14:02:13 +0000 (-0400) Subject: Add proper exit code X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=cbde02b39d3ec7a809f529ec9e83afaaad0f84fd;p=hvutilities.git Add proper exit code --- diff --git a/scripts/git-project-update.sh b/scripts/git-project-update.sh index 0a37cc1..302a4f8 100755 --- a/scripts/git-project-update.sh +++ b/scripts/git-project-update.sh @@ -32,6 +32,7 @@ if [ ! -f ${SUBREPOS_LIST} ]; then fi branch=${1} +rc=0 update_repo() { @@ -53,6 +54,10 @@ update_repo() exists=$(git show-ref refs/heads/${b}) if [ -n "$exists" ]; then vco -q ${b} 1> /dev/null + + if [ ${?} -ne 0 ]; then + rc=1 + fi echo "${b}" valid="1" break @@ -61,6 +66,7 @@ update_repo() if [ x"${valid}" = x"0" ]; then echo "No valid branch found" + rc=1 fi popd 1> /dev/null @@ -87,3 +93,5 @@ while IFS=$'\n' read r ; do update_repo ${r} done < ${SUBREPOS_LIST} + +exit ${rc}