mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-02-27 19:57:07 +05:00
16 lines
374 B
Python
16 lines
374 B
Python
import subprocess
|
|
Import("env")
|
|
|
|
try:
|
|
commit_hash = "undefined"
|
|
result = subprocess.check_output(
|
|
["git", "rev-parse", "--short", "HEAD"]
|
|
)
|
|
commit_hash = result.decode("utf-8").strip()
|
|
env.Append(
|
|
CPPDEFINES=[
|
|
("BUILD_COMMIT", '\\"{}\\"'.format(commit_hash))
|
|
]
|
|
)
|
|
except Exception as error:
|
|
print("Failed to get commit hash: {}".format(error)) |