Skip to content

💫 Toolkit to help you get started with SDD or any other process!

Unset CDPATH while getting SCRIPT_DIR

San Gillis2a7c2e939819
diff --git a/scripts/bash/check-prerequisites.sh b/scripts/bash/check-prerequisites.sh
index 54f32ec36..98e387c27 100644
--- a/scripts/bash/check-prerequisites.sh
+++ b/scripts/bash/check-prerequisites.sh
@@ -75,7 +75,7 @@ EOF
done
# Source common functions
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/common.sh"
# Get feature paths and validate branch
diff --git a/scripts/bash/common.sh b/scripts/bash/common.sh
index 6931eccc8..2c3165e41 100644
--- a/scripts/bash/common.sh
+++ b/scripts/bash/common.sh
@@ -7,7 +7,7 @@ get_repo_root() {
git rev-parse --show-toplevel
else
# Fall back to script location for non-git repos
- local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ local script_dir="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
(cd "$script_dir/../../.." && pwd)
fi
}
diff --git a/scripts/bash/create-new-feature.sh b/scripts/bash/create-new-feature.sh
index 86d9ecf83..ef4910b3e 100644
--- a/scripts/bash/create-new-feature.sh
+++ b/scripts/bash/create-new-feature.sh
@@ -114,7 +114,7 @@ check_existing_branches() {
# Resolve repository root. Prefer git information when available, but fall back
# to searching for repository markers so the workflow still functions in repositories that
# were initialised with --no-git.
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if git rev-parse --show-toplevel >/dev/null 2>&1; then
REPO_ROOT=$(git rev-parse --show-toplevel)
diff --git a/scripts/bash/setup-plan.sh b/scripts/bash/setup-plan.sh
index 740a1438c..d01c6d6cb 100644
--- a/scripts/bash/setup-plan.sh
+++ b/scripts/bash/setup-plan.sh
@@ -24,7 +24,7 @@ for arg in "$@"; do
done
# Get script directory and load common functions
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/common.sh"
# Get all paths and variables from common functions
diff --git a/scripts/bash/update-agent-context.sh b/scripts/bash/update-agent-context.sh
index 2a44c68a1..e31fbe00e 100644
--- a/scripts/bash/update-agent-context.sh
+++ b/scripts/bash/update-agent-context.sh
@@ -49,7 +49,7 @@ set -o pipefail
#==============================================================================
# Get script directory and load common functions
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/common.sh"
# Get all paths and variables from common functions