From f5ab347c030e9b191f7a8ed9b6e54760c6d6eeab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Wed, 31 Dec 2014 22:57:53 +0100 Subject: [PATCH] Add bump.sh script to master branch too --- scripts/bump.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 scripts/bump.sh diff --git a/scripts/bump.sh b/scripts/bump.sh new file mode 100755 index 0000000..445622e --- /dev/null +++ b/scripts/bump.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "Usage: $0 VERSION" >&2 + exit 1 +fi + +VERSION=$1 + +if ! echo $VERSION | grep "^[0-9.]"; then + echo "invalid version"; + exit 1 +fi + +cd $(dirname $0)/.. + +sed -i 's/(defconst ghc-version ".*")/(defconst ghc-version "'"$VERSION"'")/' \ + elisp/ghc.el + +sed -r -i 's/^(Version:[[:space:]]*)[0-9.]+/\1'"$VERSION"'/' ghc-mod.cabal + +( tac ChangeLog; echo "\n$(date '+%Y-%m-%d') v$VERSION" ) | tac \ + > ChangeLog.tmp + +mv ChangeLog.tmp ChangeLog + +emacs -q -nw ChangeLog + +git add ChangeLog elisp/ghc.el ghc-mod.cabal +git commit -m "Bump version to $VERSION" +git tag "v$VERSION"