Ultron/ultron/core/context_processors.py

13 lines
329 B
Python
Raw Normal View History

import subprocess
def git_describe(request) -> str:
return {
"git_describe": subprocess.check_output(
["git", "describe", "--always"]
).decode(),
"git_date": subprocess.check_output(
["git", "show", "-s", r"--format=%cd", r"--date=format:%d-%m-%Y"]
).decode(),
}