From 485687a6240ec384111499d8c63baab1443a6ed0 Mon Sep 17 00:00:00 2001 From: Dmitry Kabanov Date: Fri, 24 Jan 2025 12:10:19 +0100 Subject: [PATCH] [misc] Make env.sh source'able not only in ZSH but also in Bash --- env.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/env.sh b/env.sh index 3dc0a338..f2adc701 100644 --- a/env.sh +++ b/env.sh @@ -1,8 +1,13 @@ # Set project root directory to use absolute paths below. +export PRJ_ROOT_DIR="" if [ "$GITHUB_ACTIONS" = "true" ]; then - export PRJ_ROOT_DIR="$GITHUB_WORKSPACE" + PRJ_ROOT_DIR="$GITHUB_WORKSPACE" else - export PRJ_ROOT_DIR="$(dirname $(realpath "$0"))" + if [ "$0" = "-bash" ]; then + PRJ_ROOT_DIR="$(dirname "$(realpath ${BASH_SOURCE[0]})")" + else + PRJ_ROOT_DIR="$(dirname "$(realpath "$0")")" + fi fi # Set path to implementations