From 9ba1dc2925df45bce1108f6f65234d153f4135f2 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Tue, 17 May 2022 12:04:56 +0200 Subject: [PATCH] Insert absolute path --- advlabdb/scripts/setup/logged_server_setup.py | 2 +- advlabdb/scripts/setup/server_setup.py | 3 ++- advlabdb/scripts/setup/shared.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/advlabdb/scripts/setup/logged_server_setup.py b/advlabdb/scripts/setup/logged_server_setup.py index 1769119..e96de24 100644 --- a/advlabdb/scripts/setup/logged_server_setup.py +++ b/advlabdb/scripts/setup/logged_server_setup.py @@ -5,7 +5,7 @@ from pathlib import Path from shared import LOCAL_BIN, LOGS_DIR, install_latest_pipx, poetry_update -sys.path.insert(0, "..") +sys.path.insert(0, Path(__file__).parent.absolute()) from terminal_utils import run, step diff --git a/advlabdb/scripts/setup/server_setup.py b/advlabdb/scripts/setup/server_setup.py index 40e9f0b..2e81dd0 100644 --- a/advlabdb/scripts/setup/server_setup.py +++ b/advlabdb/scripts/setup/server_setup.py @@ -1,10 +1,11 @@ # No relative imports allowed in this file to be able to run server_setup.py without packages import sys +from pathlib import Path from shared import LOGS_DIR, REPO_DIR -sys.path.insert(0, "..") +sys.path.insert(0, Path(__file__).parent.absolute()) from terminal_utils import run diff --git a/advlabdb/scripts/setup/shared.py b/advlabdb/scripts/setup/shared.py index 2036342..05cbf3b 100644 --- a/advlabdb/scripts/setup/shared.py +++ b/advlabdb/scripts/setup/shared.py @@ -3,7 +3,7 @@ import sys from pathlib import Path -sys.path.insert(0, "..") +sys.path.insert(0, Path(__file__).parent.absolute()) from terminal_utils import run LOCAL_BIN = Path("/home/admin/.local/bin/")