snapraid/autover.sh
2015-12-19 10:07:20 +01:00

14 lines
292 B
Bash
Executable file

#!/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"