From ba723441579da22d1fd9f754f50b6c239a6892e5 Mon Sep 17 00:00:00 2001 From: ptruessel Date: Mon, 21 Oct 2024 16:08:13 +0200 Subject: [PATCH] Test with env path --- config/backup/restore.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config/backup/restore.sh b/config/backup/restore.sh index cee6146..adbeea5 100644 --- a/config/backup/restore.sh +++ b/config/backup/restore.sh @@ -3,8 +3,14 @@ # Activates the automatic export of variables set -a -# Load the .env file -source ../../.env +# Get the directory of the current script +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Set the project root (assuming the script is two levels below the project root) +PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")" + +# Load the .env file from the project root +source "$PROJECT_ROOT/.env" # Deactivates the automatic export of variables set +a