snapraid/autover.sh
2019-01-07 14:06:15 +01:00

20 lines
331 B
Bash
Executable File

#!/bin/sh
#
if [ -d .git ]; then
# Get version from git tags, removing the 'v' prefix
VERSION=`git describe --match 'v*' 2>/dev/null | sed 's/^v//'`
fi
if [ -f .version ]; then
# Get version from the .version file
VERSION=`cat .version`
fi
if [ -z $VERSION ]; then
VERSION="none"
fi
printf '%s' "$VERSION"