From 4ccb409c5601273fdcbfc9962e6b43b3119931ab Mon Sep 17 00:00:00 2001 From: Alexey <1556417+alex-solovyev@users.noreply.github.com> Date: Sat, 28 Feb 2026 09:12:36 +0100 Subject: [PATCH] fix: use POSIX-compatible parameter expansion for SCRIPT_DIR resolution Replace `dirname` with ${BASH_SOURCE[0]%/*} in issue-sync-helper.sh and issue-sync-lib.sh so they work in stripped PATH environments (e.g., Claude Code MCP pulse sessions) where `dirname` is not available. Closes #2605 --- .agents/scripts/issue-sync-helper.sh | 2 +- .agents/scripts/issue-sync-lib.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.agents/scripts/issue-sync-helper.sh b/.agents/scripts/issue-sync-helper.sh index 5052be77db..898ac9f791 100755 --- a/.agents/scripts/issue-sync-helper.sh +++ b/.agents/scripts/issue-sync-helper.sh @@ -18,7 +18,7 @@ set -euo pipefail -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit +SCRIPT_DIR="$(cd "${BASH_SOURCE[0]%/*}" && pwd)" || exit source "${SCRIPT_DIR}/shared-constants.sh" # shellcheck source=issue-sync-lib.sh source "${SCRIPT_DIR}/issue-sync-lib.sh" diff --git a/.agents/scripts/issue-sync-lib.sh b/.agents/scripts/issue-sync-lib.sh index 09fe44b292..8b20366167 100755 --- a/.agents/scripts/issue-sync-lib.sh +++ b/.agents/scripts/issue-sync-lib.sh @@ -28,7 +28,7 @@ _ISSUE_SYNC_LIB_LOADED=1 # Source shared-constants.sh to make the library self-contained. # Resolves SCRIPT_DIR from BASH_SOURCE so it works when sourced from any location. if [[ -z "${SCRIPT_DIR:-}" ]]; then - SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + SCRIPT_DIR="$(cd "${BASH_SOURCE[0]%/*}" && pwd)" fi source "${SCRIPT_DIR}/shared-constants.sh"