don't fail on first error, but continue on other modules
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Thu, 1 Jul 2010 14:58:50 +0000 (16:58 +0200)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Thu, 1 Jul 2010 14:58:50 +0000 (16:58 +0200)
scripts/git-mirror.sh

index 83f8e8c..1ddcd57 100755 (executable)
@@ -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
 }