Fix version generation error without git in Linux/Mac

This commit is contained in:
bnnm 2019-09-02 20:42:00 +02:00
parent f7a0e460dc
commit 93a3a03fc6

View File

@ -1,4 +1,11 @@
#!/bin/sh
DIR="`dirname "$0"`"
VERSION="`git describe --always | tr : _`"
echo "$VERSION"
# get current git version, redirect stderr to stdin, change : to _
VERSION=$(git describe --always --tag 2>&1 | tr : _ )
# ignore git stderr "fatal:
if case $VERSION in fatal*) ;; *) false;; esac; then
echo ""
else
echo "$VERSION"
fi;