Add version support also at the source distribution

This commit is contained in:
Andrea Mazzoleni 2015-12-19 10:07:20 +01:00
parent ef84db7477
commit 06e0954d5e
3 changed files with 20 additions and 2 deletions

14
autover.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/sh
#
if [ -d .git ]; then
# Get version from git tags, removing the 'v' prefix
VERSION=`git describe --match 'v*' | sed 's/^v//'`
elif [ -f .version ]; then
# Get version from the .version file
VERSION=`cat .version`
else
VERSION="none"
fi
printf '%s' "$VERSION"