diff options
Diffstat (limited to 'scripts/version.sh')
-rwxr-xr-x | scripts/version.sh | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/version.sh b/scripts/version.sh index 9a965dc..03fb3aa 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -5,8 +5,12 @@ GIT_DIR="${SCRIPT_DIR}/../.git" if test -d "${GIT_DIR}" ; then if type git >/dev/null 2>&1 ; then - git describe --match '[0-9]*.[0-9]*.[0-9]*' 2>/dev/null \ - | sed -e 's/-/-git-/' + gitstr=$(git describe --match '[0-9]*.[0-9]*.*' 2>/dev/null) + if test "x$?" != x0 ; then + sed 's/$/-git/' < VERSION + else + printf "%s\n" "$gitstr" | sed -e 's/-g/-git-/' + fi else sed 's/$/-git/' < VERSION fi |