mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-22 10:43:11 +00:00
25 lines
579 B
Python
25 lines
579 B
Python
import subprocess
|
|
import datetime
|
|
from functools import cache
|
|
|
|
|
|
@cache
|
|
def get_fast_git_version_id():
|
|
try:
|
|
version = (
|
|
subprocess.check_output(
|
|
[
|
|
"git",
|
|
"describe",
|
|
"--always",
|
|
"--dirty",
|
|
"--all",
|
|
"--long",
|
|
]
|
|
)
|
|
.strip()
|
|
.decode()
|
|
)
|
|
return (version, datetime.date.today())
|
|
except Exception as e:
|
|
print("Failed to check for git changes", e)
|