mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
1387ee9a3a
Previously, this file had to be manually deleted if you wanted to have a new version compiled in.
8 lines
313 B
Python
8 lines
313 B
Python
import subprocess
|
|
try:
|
|
git_hash = subprocess.check_output(["git", "rev-parse", "--short=16", "HEAD"], stderr=None).decode().strip()
|
|
definition = '"{}"'.format(git_hash)
|
|
except (FileNotFoundError, subprocess.CalledProcessError):
|
|
definition = "0";
|
|
print("const char *GIT_SHORTREV_HASH = {};".format(definition))
|