feat: show commit info in footer
This commit is contained in:
10
FlaskWebProject/FlaskWebProject/lewy_globals.py
Normal file
10
FlaskWebProject/FlaskWebProject/lewy_globals.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from git import Repo # hash ostatniego commitu
|
||||
|
||||
def getCommit():
|
||||
repo = "<p>Brak informacji o wersji skryptu</p>"
|
||||
try:
|
||||
repo = Repo(search_parent_directories=True).head.object.hexsha
|
||||
repo = f"<p>Commit: <a href='https://gitea.7o7.cx/roberteam/lewangoalski/commit/{repo}' style='width: 50%'>{repo[:11]}</a></p>"
|
||||
except:
|
||||
pass
|
||||
return repo
|
||||
Reference in New Issue
Block a user