Skip to content

Instantly share code, notes, and snippets.

@rudiedirkx
Created August 18, 2010 23:32
Show Gist options
  • Save rudiedirkx/536533 to your computer and use it in GitHub Desktop.
Save rudiedirkx/536533 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Read old version from file, make new version, save to file
# file VERSION should be in the root of the project, beside README
# VERSION should *always* be formatted according to GNU version scheme: major.minor.revision
version=$(< VERSION)
major=`echo $version | awk -F"." '{print $1}'`
minor=`echo $version | awk -F"." '{print $2}'`
revision=`echo $version | awk -F"." '{print $3}'`
revision=$(($revision+1))
version=$major"."$minor"."$revision
# save to file
echo -n $version > VERSION
# echo for committer
echo $version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment