Handle running from outside repo when reporting version

This commit is contained in:
Isaiah Odhner 2023-09-04 19:37:07 -04:00
parent 1897dbe386
commit b818c2c99b

View File

@ -13,4 +13,4 @@ __license__ = "MIT"
from os.path import exists, dirname from os.path import exists, dirname
from subprocess import check_output from subprocess import check_output
if exists(dirname(__file__) + "/../../.git"): if exists(dirname(__file__) + "/../../.git"):
__version__ = "development " + check_output(["git", "describe", "--tags"]).strip().decode() __version__ = "development " + check_output(["git", "describe", "--tags"], cwd=dirname(__file__)).strip().decode()