TRX/tools/shared/versioning.py
2024-03-26 21:11:01 +01:00

16 lines
337 B
Python

from subprocess import run
def generate_version() -> str:
cmd = [
"git",
"describe",
"--always",
"--abbrev=7",
"--tags",
"--dirty",
"--exclude",
"latest",
]
version = run(cmd, capture_output=True, text=True).stdout.strip()
return f'TR1X {version or "?"}'