aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild-aux/git-version-gen5
1 files changed, 3 insertions, 2 deletions
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 2cc88fc..331faef 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -10,8 +10,9 @@ VERFILE="$1"
if [ -d '.git' ]
then
- VERSION=`git describe --abbrev=4 --match='v[0-9]*' --dirty | sed 's/^v//'`
- echo -n "$VERSION" > "$VERFILE"
+ VERSION=`git describe --abbrev=4 --match='v[0-9]*' --dirty 2>/dev/null`
+ VERSION=`echo "$VERSION" | sed 's/^v//'`
+ [ -n "$VERSION" ] && echo -n "$VERSION" > "$VERFILE"
fi
if [ -f "$VERFILE" ]