Skip to content

Commit

Permalink
better version update script
Browse files Browse the repository at this point in the history
  • Loading branch information
winitzki committed Jan 23, 2017
1 parent fcf6cb5 commit 6b743cc
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions update_version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
#!/bin/bash

VERSION=`git tag --sort=-taggerdate|head -1`
VERSION=$1

if [[ -z $VERSION ]]
then
echo "Usage: $0 <version>"
echo "where <version> can be 1.0.4 or so"
exit 1
fi

if git tag --sort=-taggerdate | fgrep -q $VERSION
then
echo Error: Tag $VERSION already exists.
exit 1
fi

function safe_move {
local file1="$1" file2="$2"
Expand Down Expand Up @@ -29,4 +42,16 @@ safe_move build.sbt.new build.sbt

# Check whether the version history has been updated, warn otherwise.

grep -q "^- $VERSION " docs/roadmap.md || echo "Warning: docs/roadmap.md does not seem to have information about the current version $VERSION."
if grep -q "^- $VERSION " docs/roadmap.md
then
echo "Preparing new release $VERSION"
else
echo "Error: docs/roadmap.md does not seem to have information about the current version $VERSION."
exit 1
fi

git add build.sbt README.md
git commit -m "update for release $VERSION"
git tag $VERSION

echo "All done, now push to github using git push origin <branch> --tags"

0 comments on commit 6b743cc

Please sign in to comment.