Skip to content

Commit

Permalink
Add version bumping script
Browse files Browse the repository at this point in the history
  • Loading branch information
fimad committed Feb 5, 2017
1 parent 3ae49d5 commit ddab353
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions bump-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
# Bump the various hard coded scalpel version numbers.

set -e

if [ "$#" != "1" ]
then
echo "usage: $0 VERSION"
exit -1
fi

version="$1"

echo "Updating CHANGLOG.md"
sed -i -r "s/^(## HEAD)$/\1\n\n## $version/" CHANGELOG.md

bump-cabal() {
cabal="$1"
echo "Updating $cabal"

# The version number of the package.
sed -i -r "s/^(version:\s+)[0-9.]+$/\1$version/" "$cabal"

# The version number in the git tag for the current release.
sed -i -r "s/^(\s*tag:\s+v)[0-9.]+$/\1$version/" "$cabal"

# The version of the scalpel-core dependency.
sed -i -r "s/^([ ,]+scalpel-core\s*==\s*)[0-9.]+$/\1$version/" "$cabal"
}

bump-cabal "scalpel/scalpel.cabal"
bump-cabal "scalpel-core/scalpel-core.cabal"

git diff --color=always | cat -
echo -en "\nDoes this look OK? [N/y] "
read ok && [ "$ok" == "y" ]

git commit -a -m "Bump version to $version"

0 comments on commit ddab353

Please sign in to comment.