summaryrefslogtreecommitdiff
path: root/protocols/Telegram/tdlib/td/gen_git_commit_h.sh
blob: b3416b2983d91b93d3dd34e574d82130c099fc2b (plain)
1
2
3
4
5
6
7
8
9
10
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