summaryrefslogtreecommitdiff
path: root/version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'version.sh')
-rwxr-xr-xversion.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/version.sh b/version.sh
new file mode 100755
index 0000000..6716dff
--- /dev/null
+++ b/version.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+METASTORE_PRETAG_VER=1.0.999
+
+cd "${0%/*}" && \
+METASTORE_VER="$(\
+{ git describe --tags 2>/dev/null \
+ || grep -no '^v[0-9][^ ]*' NEWS \
+ || echo $METASTORE_PRETAG_VER; \
+} | sed '/^1:/s,,,;/:/{s,[^:]*:,,;s,$,+,};q' \
+)"
+
+echo "$METASTORE_VER_PREFIX$METASTORE_VER$METASTORE_VER_SUFFIX"