Skip to content

Commit

Permalink
Add a script to make the version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
b4n committed Nov 13, 2016
1 parent 5241f40 commit a4990e9
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions scripts/version-bump
@@ -0,0 +1,40 @@
#!/bin/sh

set -e

if [ $# -ne 2 ]; then
echo "USAGE: $0 VERSION CODENAME" >&2
exit 1
fi

VER=$1
FULLVER=$VER
CODENAME=$2

[ "$(echo "$FULLVER" | grep -o -F . | wc -c)" -lt 3 ] && FULLVER="$FULLVER.0"

# update the files
sed -e 's/^\(.. |(version)| replace:: \).*$/\1'"$VER"'/' -i doc/geany.txt
sed -e 's/^\([ ]*version="\)[^"]*\("\)/\1'"$FULLVER"'.0\2/' -i geany.exe.manifest

sed -e '
s/^\(#define VER_FILEVERSION *\)[^ ].*$/\1'"$(echo "$FULLVER" | tr . ,)"',0/
s/^\(#define VER_FILEVERSION_STR *\)[^ ].*$/\1"'"$VER"'"/
' -i geany_private.rc

sed -e 's/^\(AC_INIT([^,]*, *\[\)[^]]*\(\],\)/\1'"$VER"'\2/' -i configure.ac
sed -e 's/^\(#define GEANY_CODENAME[ ]*"\)[^"]*\("\)/\1'"$CODENAME"'\2/' -i src/geany.h

sed -e '
1i Geany '"$VER"' (unreleased)\n\n
' -i NEWS

# show commit message to use
cat <<EOF
Message for the commit, after you have checked the changes:
-----------------------------------------------------------
Post release version bump
Say hello to Geany $VER "$CODENAME"!
EOF

0 comments on commit a4990e9

Please sign in to comment.