Add version loading

This commit is contained in:
2022-07-15 02:55:18 +02:00
parent 108d70253c
commit 8cc9ed3645
2 changed files with 7 additions and 5 deletions

View File

@ -36,7 +36,9 @@ def check_config_exists():
return os.path.isfile(config_file)
def load_version(app):
if os.path.isfile(".version"):
if os.environ.get("SOURCE_VERSION"):
app.config['VERSION'] = os.environ.get("SOURCE_VERSION")
elif os.path.isfile(".version"):
with open('.version', 'r') as file:
data = file.read().replace('\n', '')
if data: