Source

hpaco / bump-version

Full commit
#!/usr/bin/env bash
# Bump the version in three places:
# - the cabal file (reporting the version to hackage)
# - CommandArgs.hs (for --help)
# - create a git repository tag
# Also auto-commits both the modified files.
VERSION=$1
cd `dirname $0`
sed -i'~' hpaco.cabal -e '2,2s/^\(version:\s*\)[^\s]\+$/\1'$VERSION'/'
sed -i'~' CommandArgs.hs -e 's/^programVersion = .*$/programVersion = "'$VERSION'"/'
rm hpaco.cabal~ CommandArgs.hs~
git commit -am'Bumped version'
git tag $VERSION