function error () {
echo "[ERROR] xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $1"
- exit 1
}
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}
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
}