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.
This commit is contained in:
Frank Denis
2016-01-16 15:31:58 +01:00
parent b2cb8ebcbe
commit a50882e1ac

View File

@@ -1,6 +1,7 @@
#!/bin/sh #!/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} && VERSION=${VERSION#v}
[ -z "${VERSION}" ] && VERSION=`cat VERSION 2>/dev/null` [ -z "${VERSION}" ] && VERSION=`cat VERSION 2>/dev/null`