feat: differentiate between commit and html-formatted commit
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
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}'>{repo[:11]}</a></p>"
|
||||
return Repo(search_parent_directories=True).head.object.hexsha
|
||||
except:
|
||||
pass
|
||||
return None
|
||||
|
||||
def getCommitInFormattedHTML():
|
||||
repo = "<p>Brak informacji o wersji skryptu</p>"
|
||||
commit = getCommit()
|
||||
|
||||
if commit is not None:
|
||||
repo = f"<p>Commit: <a href='https://gitea.7o7.cx/roberteam/lewangoalski/commit/{commit}'>{commit[:11]}</a></p>"
|
||||
|
||||
return repo
|
||||
Reference in New Issue
Block a user