Skip to content

Commit 0fa9f42

Browse files
committed
test(smoke): platform-branch the shim check for the Windows .cmd form
The 8e gate compared uname -s to the bare literal MINGW64_NT, which never matches the real value (MINGW64_NT-10.0-...), so the POSIX branch silently ran on Windows and looked for the extensionless shim that DeusData#929 no longer installs. Branch by platform prefix: Windows expects the .cmd shim and the absence of the legacy extensionless twin; POSIX unchanged. Content checks (never blocks, delegates to hook-augment) now run on both. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent b1502bf commit 0fa9f42

1 file changed

Lines changed: 32 additions & 15 deletions

File tree

‎scripts/smoke-test.sh‎

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -977,22 +977,39 @@ fi
977977
echo "OK 8d: Claude Code PreToolUse hook (matcher=Grep|Glob|Read)"
978978

979979
# 8e: Claude Code shim script — must be non-blocking augmenter, not a gate.
980-
if [ "$(uname -s)" != "MINGW64_NT" ] 2>/dev/null; then
981-
GATE_SCRIPT="$FAKE_HOME/.claude/hooks/cbm-code-discovery-gate"
982-
if [ ! -x "$GATE_SCRIPT" ]; then
983-
echo "FAIL 8e: shim script not executable or missing"
984-
exit 1
985-
fi
986-
if grep -q 'exit 2' "$GATE_SCRIPT"; then
987-
echo "FAIL 8e: shim contains 'exit 2' — must never block"
988-
exit 1
989-
fi
990-
if ! grep -q 'hook-augment' "$GATE_SCRIPT"; then
991-
echo "FAIL 8e: shim missing 'hook-augment' delegation"
992-
exit 1
993-
fi
994-
echo "OK 8e: shim installed, non-blocking, delegates to hook-augment"
980+
# #929: Windows installs a .cmd script (extensionless bash shims triggered the
981+
# Open-With dialog); the old `!= "MINGW64_NT"` gate never matched the real
982+
# uname (MINGW64_NT-10.0-...), so this check silently ran the POSIX branch on
983+
# Windows. Branch by platform prefix instead.
984+
case "$(uname -s)" in
985+
MINGW*|MSYS*|CYGWIN*)
986+
GATE_SCRIPT="$FAKE_HOME/.claude/hooks/cbm-code-discovery-gate.cmd"
987+
if [ ! -f "$GATE_SCRIPT" ]; then
988+
echo "FAIL 8e: .cmd shim missing on Windows"
989+
exit 1
990+
fi
991+
if [ -f "$FAKE_HOME/.claude/hooks/cbm-code-discovery-gate" ]; then
992+
echo "FAIL 8e: legacy extensionless shim still installed on Windows"
993+
exit 1
994+
fi
995+
;;
996+
*)
997+
GATE_SCRIPT="$FAKE_HOME/.claude/hooks/cbm-code-discovery-gate"
998+
if [ ! -x "$GATE_SCRIPT" ]; then
999+
echo "FAIL 8e: shim script not executable or missing"
1000+
exit 1
1001+
fi
1002+
;;
1003+
esac
1004+
if grep -q 'exit 2' "$GATE_SCRIPT"; then
1005+
echo "FAIL 8e: shim contains 'exit 2' — must never block"
1006+
exit 1
1007+
fi
1008+
if ! grep -q 'hook-augment' "$GATE_SCRIPT"; then
1009+
echo "FAIL 8e: shim missing 'hook-augment' delegation"
1010+
exit 1
9951011
fi
1012+
echo "OK 8e: shim installed, non-blocking, delegates to hook-augment"
9961013

9971014
# 8f-8h: Codex TOML
9981015
if ! grep -q '\[mcp_servers.codebase-memory-mcp\]' "$FAKE_HOME/.codex/config.toml"; then

0 commit comments

Comments
 (0)