Created
February 14, 2017 16:37
-
-
Save lukin0110/f4bb4e1def946c170e93387908205cfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -f VERSION ]; then | |
BASE_STRING=`cat VERSION` | |
BASE_LIST=(`echo $BASE_STRING | tr '.' ' '`) | |
V_MAJOR=${BASE_LIST[0]} | |
V_MINOR=${BASE_LIST[1]} | |
V_PATCH=${BASE_LIST[2]} | |
echo "Current version : $BASE_STRING" | |
# V_MINOR=$((V_MINOR + 1)) | |
V_PATCH=$((V_PATCH + 1)) | |
SUGGESTED_VERSION="$V_MAJOR.$V_MINOR.$V_PATCH" | |
read -p "Enter a version number [$SUGGESTED_VERSION]: " INPUT_STRING | |
if [ "$INPUT_STRING" = "" ]; then | |
INPUT_STRING=$SUGGESTED_VERSION | |
fi | |
echo "Will set new version to be $INPUT_STRING" | |
echo $INPUT_STRING > VERSION | |
echo "Version $INPUT_STRING:" > tmpfile | |
git add VERSION | |
git commit -m "Version bump to $INPUT_STRING" | |
git tag -a -m "Tagging version $INPUT_STRING" "v$INPUT_STRING" | |
git push origin --tags | |
else | |
echo "Could not find a VERSION file" | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment