Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/version
diff options
context:
space:
mode:
Diffstat (limited to 'version')
-rwxr-xr-xversion12
1 files changed, 12 insertions, 0 deletions
diff --git a/version b/version
new file mode 100755
index 0000000..8ab42cb
--- /dev/null
+++ b/version
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+
+import re
+import subprocess
+import sys
+
+description = subprocess.check_output(["git", "describe"])
+match = re.match(r"v([\d\.]+)", description)
+if match:
+ sys.stdout.write(match.groups()[0])
+else:
+ raise Exception("Unknown version. Please create an annotated tag.")