If the latest commit is a tag,

This commit is contained in:
李铭昕 2019-06-23 21:32:13 +08:00
parent 9268af104e
commit 084fb736c6

View File

@ -8,6 +8,7 @@ then
exit 1
fi
NOW=$(date +%s)
CURRENT_BRANCH="master"
VERSION=$1
BASEPATH=$(cd `dirname $0`; cd ../src/; pwd)
@ -24,7 +25,7 @@ for REMOTE in $repos
do
echo ""
echo ""
echo "Releasing $REMOTE";
echo "Cloning $REMOTE";
TMP_DIR="/tmp/hyperf-split"
REMOTE_URL="git@github.com:hyperf-cloud/$REMOTE.git"
@ -37,7 +38,14 @@ do
git clone $REMOTE_URL .
git checkout "$CURRENT_BRANCH";
git tag $VERSION
git push origin --tags
if [[ $(git log --pretty="%d" -n 1 | grep tag --count) -eq 0 ]]; then
echo "Releasing $REMOTE"
git tag $VERSION
git push origin --tags
fi
)
done
done
TIME=$(echo "$(date +%s) - $NOW" | bc)
printf "Execution time: %f seconds" $TIME