diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2021-10-09 15:35:08 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2021-10-09 15:35:08 +0200 |
commit | 9c187aa020cab67ccafba03b6907c3913573487c (patch) | |
tree | c8b5dc22c9d47d40d66f583a9451be38f76f53e3 /contrib | |
parent | c5e203bf6aa5f0dd86e3214e6ed7fa854751ed3a (diff) | |
download | gnunet-9c187aa020cab67ccafba03b6907c3913573487c.tar.gz gnunet-9c187aa020cab67ccafba03b6907c3913573487c.zip |
-fallback to .version file outside of git
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/get_version.sh | 21 |
1 files 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 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | VERSION=$(git describe --tags) | 2 | # Gets the version number from git, or from the contents of .version |
3 | VERSION=${VERSION:1:${#VERSION}} | 3 | VERSION= |
4 | echo $VERSION > .version | 4 | if test -f ".version" |
5 | echo -n $VERSION | 5 | then |
6 | VERSION=$(cat .version) | ||
7 | fi | ||
8 | if test "x$VERSION" = "x" -a -d "./.git" | ||
9 | then | ||
10 | VERSION=$(git describe --tags) | ||
11 | VERSION=${VERSION:1:${#VERSION}} | ||
12 | echo $VERSION > .version | ||
13 | fi | ||
14 | if test "x$VERSION" = "x" | ||
15 | then | ||
16 | VERSION="unknown" | ||
17 | fi | ||
18 | echo -n "$VERSION" | ||