summaryrefslogtreecommitdiff
path: root/libs/tdlib/td/gen_git_commit_h.sh
diff options
context:
space:
mode:
authorMataes <mataes2007@gmail.com>2018-04-27 20:39:22 +0300
committerMataes <mataes2007@gmail.com>2018-04-27 20:39:22 +0300
commitb9ce1d4d98525490ca1a38e2d9fd4f3369adb3e0 (patch)
tree787c80a909776c1c4d099b638c83c7977bb070e2 /libs/tdlib/td/gen_git_commit_h.sh
parent5ed0126c16d061d6e87aa20c718e14608c66feec (diff)
added tdlib library
Diffstat (limited to 'libs/tdlib/td/gen_git_commit_h.sh')
-rw-r--r--libs/tdlib/td/gen_git_commit_h.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/tdlib/td/gen_git_commit_h.sh b/libs/tdlib/td/gen_git_commit_h.sh
new file mode 100644
index 0000000000..b3416b2983
--- /dev/null
+++ b/libs/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