TRX/tools/shared/versioning.py

16 lines
318 B
Python
Raw Normal View History

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