From 960a5e4cb09eaca7ee345864b3bf1e4bc495c4d9 Mon Sep 17 00:00:00 2001 From: BenediktMKuehne Date: Fri, 12 Jul 2024 08:42:39 +0000 Subject: [PATCH] fix VERSION input --- embark/embark/helper.py | 7 +++++-- run-server.sh | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/embark/embark/helper.py b/embark/embark/helper.py index b5515209..4df2e23a 100644 --- a/embark/embark/helper.py +++ b/embark/embark/helper.py @@ -105,8 +105,11 @@ def get_version_strings(): else: emba_version = "" - if Path("./VERSION.txt").exists(): - with open(Path("./VERSION.txt"), 'r', encoding='UTF-8') as embark_version_file: + if Path(f"{settings.BASE_DIR}/VERSION.txt").exists(): + with open(Path(f"{settings.BASE_DIR}/VERSION.txt"), 'r', encoding='UTF-8') as embark_version_file: + embark_version = embark_version_file.read().splitlines()[0] + elif Path(f"{settings.BASE_DIR.parent}/VERSION.txt").exists(): + with open(Path(f"{settings.BASE_DIR.parent}/VERSION.txt"), 'r', encoding='UTF-8') as embark_version_file: embark_version = embark_version_file.read().splitlines()[0] else: embark_version = "" diff --git a/run-server.sh b/run-server.sh index 60633e51..b338532c 100755 --- a/run-server.sh +++ b/run-server.sh @@ -187,8 +187,10 @@ copy_file "${PWD}"/cert/embark.local.key /var/www/conf/cert copy_file "${PWD}"/cert/embark-ws.local.key /var/www/conf/cert copy_file "${PWD}"/cert/embark-ws.local.crt /var/www/conf/cert -# cp .env + +# cp .env and version copy_file ./.env /var/www/embark/embark/settings/ +copy_file ./VERSION.txt /var/www/embark/ # !DIRECTORY-CHANGE! cd /var/www/embark/ || exit 1