18 lines
503 B
Python
18 lines
503 B
Python
import subprocess
|
|
from datetime import datetime, timezone
|
|
__result_hash = subprocess.check_output(
|
|
["git", "describe", "--always", "--dirty", "--abbrev=7"],
|
|
cwd=".",
|
|
stderr=subprocess.DEVNULL,
|
|
text=True
|
|
).strip()
|
|
__result_date = subprocess.check_output(
|
|
["git", "show", "-s", "--format=%ci"],
|
|
cwd=".",
|
|
stderr=subprocess.DEVNULL,
|
|
text=True
|
|
).strip()
|
|
version = "unknown"
|
|
commit = __result_hash + " " + __result_date
|
|
timestamp = datetime.now(timezone.utc).isoformat() + "Z"
|