From a50882e1ac96faa4ca2292bee371d86fe339e971 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 16 Jan 2016 15:31:58 +0100 Subject: [PATCH] Cope with branches that don't have tags `version.sh` used to return only the hash of the last commit, causing VERSION_MAJOR to possibly contain non-numeric junk. --- version.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/version.sh b/version.sh index 204fd3f..86ae29e 100755 --- a/version.sh +++ b/version.sh @@ -1,6 +1,7 @@ #!/bin/sh -[ -z "${VERSION}" ] && VERSION=`git describe --tags --always 2>/dev/null` \ +[ -z "${VERSION}" ] && VERSION=`git describe --tags --always 2>/dev/null | \ + fgrep .` \ && VERSION=${VERSION#v} [ -z "${VERSION}" ] && VERSION=`cat VERSION 2>/dev/null`