summaryrefslogtreecommitdiffstats
path: root/Modules/describe.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/describe.sh')
-rwxr-xr-xModules/describe.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/Modules/describe.sh b/Modules/describe.sh
new file mode 100755
index 0000000..91730b8
--- /dev/null
+++ b/Modules/describe.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Check for git and a git repo.
+if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+ echo -n `git describe`
+
+ # Are there uncommitted changes?
+ git update-index --refresh --unmerged > /dev/null
+ git diff-index --quiet HEAD || echo -n -dirty
+else
+# Check for version tag
+ if [ -e version.tag ]; then
+ echo -n `cat version.tag`
+ fi
+fi
+
+echo