From cbde02b39d3ec7a809f529ec9e83afaaad0f84fd Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Fri, 5 Jul 2019 10:02:13 -0400 Subject: [PATCH] Add proper exit code --- scripts/git-project-update.sh | 8 ++++++++ 1 file changed, 8 insertions(+) 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} -- 2.20.1