mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 01:24:18 +00:00
c645c6fd72
Compatibility with Python 3.2 and lower was already removed earlier.
10 lines
333 B
Python
10 lines
333 B
Python
import subprocess
|
|
try:
|
|
git_hash = subprocess.check_output(["git", "rev-parse", "--short=16", "HEAD"], stderr=subprocess.DEVNULL).decode().strip()
|
|
definition = f'"{git_hash}"'
|
|
except FileNotFoundError:
|
|
definition = "0"
|
|
except subprocess.CalledProcessError:
|
|
definition = "0"
|
|
print(f"const char *GIT_SHORTREV_HASH = {definition};")
|