mirror of
https://github.com/SlimeVR/SlimeVR-Tracker-ESP.git
synced 2026-04-06 02:01:57 +02:00
Co-authored-by: DevMiner <tobigames200@gmail.com> Co-authored-by: nekomona <nekomona@163.com>
20 lines
396 B
Python
20 lines
396 B
Python
import subprocess
|
|
import os
|
|
|
|
revision = ""
|
|
|
|
env_rev = os.environ.get("GIT_REV")
|
|
if not env_rev is None and env_rev != "":
|
|
revision = env_rev
|
|
else:
|
|
try:
|
|
revision = (
|
|
subprocess.check_output(["git", "rev-parse", "HEAD"])
|
|
.strip()
|
|
.decode("utf-8")
|
|
)
|
|
except Exception:
|
|
revision = "NOT_GIT"
|
|
|
|
print(f"'-DGIT_REV=\"{revision}\"'")
|