Skip to content

Commit

Permalink
Updating increment_version script so that it works with the version o…
Browse files Browse the repository at this point in the history
…f sed on the CI server
  • Loading branch information
thejamesthomas committed Jul 18, 2016
1 parent 02b91c3 commit 5633ad6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions increment_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,17 @@ MINOR="$(grep minorVersion gradle.properties | cut -d = -f2)"
PATCH="$(grep patchVersion gradle.properties | cut -d = -f2)"
NEW_PATCH=$((PATCH + 1))

sed -i ".bak" "s/\(patchVersion=\).*/\1$NEW_PATCH/g" gradle.properties
rm gradle.properties.bak
if hash gsed 2>/dev/null; then
#The default version of sed on OSX is not good, so use gsed (which can be installed via
#homebrew with 'brew install gnu-sed') if it's available. I'll want to make this
#a little more robust later on
gsed -i s/patchVersion=$PATCH/patchVersion=$NEW_PATCH/g gradle.properties
else
#I'm assuming that this will be gnu-sed. I'll need to make this a little more
#strict at some point
sed -i s/patchVersion=$PATCH/patchVersion=$NEW_PATCH/g gradle.properties
fi

git add gradle.properties
git commit --author "CI <[email protected]>" -m "Updating to version $MAJOR.$MINOR.$NEW_PATCH [skip ci]"
git push origin master
git push origin master

0 comments on commit 5633ad6

Please sign in to comment.