mirror of
https://github.com/obra/superpowers.git
synced 2026-08-06 22:28:47 +08:00
fix(hooks): replace run-hook.cmd heredoc with :; label lines (#571)
bash >= 5.1 writes heredocs into a pipe pre-fork; under macOS pipe pressure the kernel hands out 512-byte pipes and the wrapper's 1.4KB CMDBLOCK heredoc deadlocks every hook. Label lines parse nowhere: cmd.exe skips them as labels, POSIX shells exec away before the batch block. Also: silent fail-open when bash or the script name is missing, and CDPATH-proof directory resolution.
This commit is contained in:
@@ -184,6 +184,15 @@ assert_command_output \
|
||||
CLAUDE_PLUGIN_ROOT="$REPO_ROOT" \
|
||||
bash "$WRAPPER_UNDER_TEST" session-start
|
||||
|
||||
# With no bash available, the wrapper must fail open: silent, exit 0.
|
||||
if output="$(env -i PATH=/nonexistent /bin/sh "$WRAPPER_UNDER_TEST" session-start 2>&1)" \
|
||||
&& [ -z "$output" ]; then
|
||||
pass "wrapper with no bash on PATH is silent and exits 0"
|
||||
else
|
||||
fail "wrapper with no bash on PATH is silent and exits 0"
|
||||
printf '%s\n' "$output" | head -3 | sed 's/^/ /'
|
||||
fi
|
||||
|
||||
cursor_home="$(make_home cursor)"
|
||||
assert_command_output \
|
||||
"Cursor emits top-level additional_context only" \
|
||||
|
||||
Reference in New Issue
Block a user