[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: -fallback to .version file outside of gi
From: |
gnunet |
Subject: |
[gnunet] branch master updated: -fallback to .version file outside of git |
Date: |
Sat, 09 Oct 2021 15:35:20 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 9c187aa02 -fallback to .version file outside of git
9c187aa02 is described below
commit 9c187aa020cab67ccafba03b6907c3913573487c
Author: Martin Schanzenbach <martin.schanzenbach@aisec.fraunhofer.de>
AuthorDate: Sat Oct 9 15:35:08 2021 +0200
-fallback to .version file outside of git
---
contrib/get_version.sh | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/contrib/get_version.sh b/contrib/get_version.sh
index b57f3524f..35eed9f94 100755
--- a/contrib/get_version.sh
+++ b/contrib/get_version.sh
@@ -1,5 +1,18 @@
#!/bin/bash
-VERSION=$(git describe --tags)
-VERSION=${VERSION:1:${#VERSION}}
-echo $VERSION > .version
-echo -n $VERSION
+# Gets the version number from git, or from the contents of .version
+VERSION=
+if test -f ".version"
+then
+ VERSION=$(cat .version)
+fi
+if test "x$VERSION" = "x" -a -d "./.git"
+then
+ VERSION=$(git describe --tags)
+ VERSION=${VERSION:1:${#VERSION}}
+ echo $VERSION > .version
+fi
+if test "x$VERSION" = "x"
+then
+ VERSION="unknown"
+fi
+echo -n "$VERSION"
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: -fallback to .version file outside of git,
gnunet <=