diff --git a/autover.sh b/autover.sh index 79256402..48f08ebb 100755 --- a/autover.sh +++ b/autover.sh @@ -3,12 +3,17 @@ 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 + 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` -else +fi + +if [ -z $VERSION ]; then VERSION="none" fi printf '%s' "$VERSION" +