mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-02 16:41:04 +03:00
Proper check for .gitversion
This commit is contained in:
parent
4ae516677e
commit
6f84e39a4a
@ -139,10 +139,12 @@ def appversion() -> semantic_version.Version:
|
|||||||
else:
|
else:
|
||||||
# Running from source. For Linux, check to see if .gitversion file exists
|
# Running from source. For Linux, check to see if .gitversion file exists
|
||||||
# If so, use it. This is also required for the Flatpak
|
# If so, use it. This is also required for the Flatpak
|
||||||
if pathlib.Path("./" + GITVERSION_FILE).is_file():
|
if pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE).exists():
|
||||||
with open(pathlib.Path("./" + GITVERSION_FILE)) as gitv:
|
print("Found .gitversion")
|
||||||
|
with open(pathlib.Path(sys.path[0] + "/" + GITVERSION_FILE), encoding='utf-8') as gitv:
|
||||||
shorthash = gitv.read()
|
shorthash = gitv.read()
|
||||||
else:
|
else:
|
||||||
|
print("Did not find .gitversion in " + sys.path[0] + "/" + GITVERSION_FILE)
|
||||||
shorthash = git_shorthash_from_head()
|
shorthash = git_shorthash_from_head()
|
||||||
if shorthash is None:
|
if shorthash is None:
|
||||||
shorthash = 'UNKNOWN'
|
shorthash = 'UNKNOWN'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user