aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/get_version.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/contrib/get_version.sh b/contrib/get_version.sh
index 6e3ab5141..00f418f3c 100755
--- a/contrib/get_version.sh
+++ b/contrib/get_version.sh
@@ -1,18 +1,18 @@
1#!/bin/sh 1#!/bin/sh
2# Gets the version number from git, or from the contents of .version 2# Gets the version number from git, or from the contents of .version
3VERSION= 3VERSION=
4if test -f ".version" 4if test -f ".version"; then
5then
6 VERSION=$(cat .version) 5 VERSION=$(cat .version)
7fi 6fi
8if [ -e ./.git ] 7if [ -e ./.git ]; then
9then 8 # With sparse checkouts, we have a .git dir but possibly no tags
10 VERSION=$(git describe --tags) 9 gitver=$(git describe --tags 2>/dev/null || echo no-git-version)
11 VERSION=${VERSION#v} 10 if test "$gitver" != "no-git-version"; then
12 echo $VERSION > .version 11 VERSION=${gitver#v}
12 echo "$VERSION" > .version
13 fi
13fi 14fi
14if test "x$VERSION" = "x" 15if test "x$VERSION" = "x"; then
15then
16 VERSION="unknown" 16 VERSION="unknown"
17fi 17fi
18case $1 in 18case $1 in