From 0070875bec8c6c93729bad8f563c721465b33d9b Mon Sep 17 00:00:00 2001 From: ptruessel Date: Mon, 21 Oct 2024 16:09:24 +0200 Subject: [PATCH] Test with env path --- config/backup/backup.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/config/backup/backup.sh b/config/backup/backup.sh index f636da4..775b247 100644 --- a/config/backup/backup.sh +++ b/config/backup/backup.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