1
0
This commit is contained in:
Your Name
2023-04-14 23:38:34 +08:00
commit ff5da79d57
1392 changed files with 378574 additions and 0 deletions

12
scripts/git_revision.py Normal file
View File

@ -0,0 +1,12 @@
import os
import subprocess
git_hash = os.environ.get("DDNET_GIT_SHORTREV_HASH")
try:
git_hash = git_hash or subprocess.check_output(["git", "rev-parse", "--short=16", "HEAD"], stderr=subprocess.DEVNULL).decode().strip()
except (FileNotFoundError, subprocess.CalledProcessError):
pass
if git_hash is not None:
definition = f'"{git_hash}"'
else:
definition = "0"
print(f"const char *GIT_SHORTREV_HASH = {definition};")