From 50f9f05daa7575411a0755a6539ad1ce7c0628c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 5 Apr 2017 13:00:22 +0200 Subject: [PATCH] Added update_version.sh to update version numbers in all the right places --- update_version.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 update_version.sh diff --git a/update_version.sh b/update_version.sh new file mode 100755 index 0000000..b5f710c --- /dev/null +++ b/update_version.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "Usage: $0 new-version" >&2 + exit 1 +fi + +sed "s/version='[^']*'/version='$1'/" -i setup.py +sed "s/__version__\s*=\s*['\"][^']*['\"]/__version__ = '$1'/" -i bam/__init__.py + +SHORTVER=$(echo -n $1 | sed 's/\.[^.]*$//') +sed "s/version = '[^']*'/version = '$SHORTVER'/" -i doc/source/conf.py +sed "s/release = '[^']*'/release = '$1'/" -i doc/source/conf.py + +MODIFIED_FILES="setup.py bam/__init__.py doc/source/conf.py" + +git diff $MODIFIED_FILES +echo +echo "Don't forget to commit and tag:" +echo git commit -m \'Bumped version to $1\' $MODIFIED_FILES +echo git tag -a v$1 -m \'Tagged version $1\'