summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/gen_git_commit_h.sh
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Telegram/tdlib/td/gen_git_commit_h.sh')
-rw-r--r--protocols/Telegram/tdlib/td/gen_git_commit_h.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Telegram/tdlib/td/gen_git_commit_h.sh b/protocols/Telegram/tdlib/td/gen_git_commit_h.sh
new file mode 100644
index 0000000000..b3416b2983
--- /dev/null
+++ b/protocols/Telegram/tdlib/td/gen_git_commit_h.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+commit=$(git rev-parse HEAD)
+git diff-index --quiet HEAD
+dirty=$?
+printf "#pragma once\n#define GIT_COMMIT \"$commit\"\n#define GIT_DIRTY $dirty\n" > auto/git_info.h.new
+if cmp -s auto/git_info.h.new auto/git_info.h 2>&1 > /dev/null
+then
+ rm -f auto/git_info.h.new
+else
+ mv -f auto/git_info.h.new auto/git_info.h
+fi