This repository has been archived on 2020-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
tdlib-fork/gen_git_commit_h.sh

12 lines
328 B
Bash
Raw Normal View History

#!/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