From: Barış Metin Date: Thu, 1 Jul 2010 14:58:50 +0000 (+0200) Subject: don't fail on first error, but continue on other modules X-Git-Tag: foo~88^2~2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=fda76465bb99efc6a0d2683932eeace5e6516926;hp=f8235726b22884aa0b2c22809c478f04e8b2b12c;p=infrastructure.git don't fail on first error, but continue on other modules --- diff --git a/scripts/git-mirror.sh b/scripts/git-mirror.sh index 83f8e8c..1ddcd57 100755 --- a/scripts/git-mirror.sh +++ b/scripts/git-mirror.sh @@ -14,7 +14,6 @@ function msg () { function error () { echo "[ERROR] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $1" - exit 1 } function run () { @@ -34,9 +33,7 @@ function run () { function mirror () { for arg in "$@" ; do - arg=$(basename $arg | sed s/.git$//g) - - NAME=$(echo ${arg} | sed 's/\/$//') + NAME=$(basename ${arg} | sed s/.git$//g) GIT_NAME=${NAME}.git REPO_DIR=${LOCAL_MIRROR_DIR}/${NAME} MIRROR_REPO=${MIRROR_GIT}/${GIT_NAME} @@ -65,10 +62,10 @@ function mirror () { if [ $? -ne 0 ] then error "Can not fetch from ${MIRROR_REPO}" + else + run "git push local_master" ${REPO_DIR} + run "git push --tags local_master" ${REPO_DIR} fi - - run "git push local_master" ${REPO_DIR} - run "git push --tags local_master" ${REPO_DIR} done }