summaryrefslogtreecommitdiffstats
path: root/printHash.sh
diff options
context:
space:
mode:
Diffstat (limited to 'printHash.sh')
-rwxr-xr-xprintHash.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/printHash.sh b/printHash.sh
new file mode 100755
index 00000000..e7d6f018
--- /dev/null
+++ b/printHash.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+> $1
+
+echo -n "#define GIT_SHA1 \"" > $1
+
+if (command -v "git" >/dev/null) then
+git rev-parse --short HEAD | tr -d '\n' >> $1
+fi
+
+echo "\"" >> $1
+echo "const char* g_GIT_SHA1 = GIT_SHA1;" >> $1 \ No newline at end of file