summaryrefslogtreecommitdiff
path: root/contrib/get_version.sh
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-07-30 10:47:14 +0200
committerChristian Grothoff <christian@grothoff.org>2021-07-30 10:47:14 +0200
commitf3181db7c364e4f91d68fb987164402dc33f68ce (patch)
treeb3af7e9de477006c2ba0fe623c95030f344ef3b3 /contrib/get_version.sh
downloadanastasis-gtk-f3181db7c364e4f91d68fb987164402dc33f68ce.tar.gz
anastasis-gtk-f3181db7c364e4f91d68fb987164402dc33f68ce.tar.bz2
anastasis-gtk-f3181db7c364e4f91d68fb987164402dc33f68ce.zip
folding history in preparation of GNU Anastasis-gtk v0.0.0 release
Diffstat (limited to 'contrib/get_version.sh')
-rwxr-xr-xcontrib/get_version.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/get_version.sh b/contrib/get_version.sh
new file mode 100755
index 0000000..3ca8a02
--- /dev/null
+++ b/contrib/get_version.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# This file is in the public domain.
+# Gets the version number from VCS, or from the contents of the file $1
+version=
+if test -f "$1"
+then
+ version=$(cat $1)
+fi
+if test "x$version" = "x" -a -d "./.git"
+then
+ version=$(git log -1 | grep 'commit [a-f0-9]\+' | sed -e 's/commit //')
+ if test ! "x$version" = "x"
+ then
+ version="git-$version"
+ fi
+fi
+if test "x$version" = "x"
+then
+ version="unknown"
+fi
+echo $version