1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

Proper check for .gitversion

This commit is contained in:
David Muckle 2023-12-24 11:25:37 -05:00
parent 4ae516677e
commit 6f84e39a4a

View File

@ -139,10 +139,12 @@ def appversion() -> semantic_version.Version:
else:
# Running from source. For Linux, check to see if .gitversion file exists
# If so, use it. This is also required for the Flatpak
if pathlib.Path("./" + GITVERSION_FILE).is_file():
with open(pathlib.Path("./" + GITVERSION_FILE)) as gitv:
if pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE).exists():
print("Found .gitversion")
with open(pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE), encoding='utf-8') as gitv:
shorthash = gitv.read()
else:
print("Did not find .gitversion in " + sys.path[0] + "/" + GITVERSION_FILE)
shorthash = git_shorthash_from_head()
if shorthash is None:
shorthash = 'UNKNOWN'