mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-02-28 04:07:07 +05:00
feat: added commit hash
This commit is contained in:
16
tools/add_build_commit.py
Normal file
16
tools/add_build_commit.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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))
|
||||
Reference in New Issue
Block a user