Fix Windows hook failures: replace bash-only hooks with cross-platform command hooks#88
Draft
calebwilson706 wants to merge 1 commit into
Draft
Fix Windows hook failures: replace bash-only hooks with cross-platform command hooks#88calebwilson706 wants to merge 1 commit into
calebwilson706 wants to merge 1 commit into
Conversation
Command-type hooks only support bash (Unix) or powershell (Windows) as platform-specific keys, plus a cross-platform command fallback. hooks.json set only bash on all three hooks, so Copilot CLI had no command to run on Windows regardless of Git Bash/WSL. Rewriting the hooks as plain Node scripts and pointing hooks.json at the command key fixes this without maintaining parallel bash/powershell implementations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.github/hooks/hooks.jsononly ranbash, which is never consulted on Windows — Copilot CLI had no command to run there at all, independent of Git Bash/WSL.hooks.jsonentry at the cross-platformcommandkey instead ofbash, so there's one implementation instead of parallel bash/powershell forks.*.sh.gitattributesrule (no.shfiles remain), and repointed the Lesson 23 reference frompre-tool-use.shtopre-tool-use.js.Test plan
pre-tool-use.jspayload matrix (JSON-string/inlinetoolArgs, edit/create/read, unrelated path, path traversal, Windows backslash path, malformed/empty stdin) — all matched expected allow/no-output + exit code.session-start.jsbootstrapstutorial/state.jsonbyte-exact, is a no-op on second run, and normalises CRLF lesson files to LF, in a scratch copy of the repo.prompt-context.jsselects the right lesson file for variouscurrentLessonvalues, falls back correctly when none match, and defaults to lesson 0 on malformed state..shfiles remain anywhere in the repo.copilotCLI run blocked by an org Copilot policy (403 unauthorized) unrelated to this change — hooks.json parsed with no schema errors, but couldn't observe a live hook invocation through the CLI. Recommend a manual spot-check (ideally on Windows) before merging.🤖 Generated with Claude Code