Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .agents/scripts/issue-sync-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" || exit
# Defensive PATH export — ensures coreutils (sed, grep, awk, jq, gh) are available
# in headless/MCP environments where PATH may be minimal.
export PATH="/usr/local/bin:/usr/bin:/bin:${PATH:-}"

# Use pure-bash parameter expansion instead of dirname (which is an external binary
# and may not be in PATH in headless/MCP environments). See issue #2602.
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"
Expand Down
4 changes: 3 additions & 1 deletion .agents/scripts/issue-sync-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ _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)"
# Use pure-bash parameter expansion instead of dirname (external binary).
# See issue #2602 — dirname may not be in PATH in headless/MCP environments.
SCRIPT_DIR="$(cd "${BASH_SOURCE[0]%/*}" && pwd)"
fi
source "${SCRIPT_DIR}/shared-constants.sh"

Expand Down