fix: Replace Unix-only shell commands with cross-platform Node.js hooks#12
Closed
unRekable wants to merge 1 commit intoitz4blitz:mainfrom
Closed
fix: Replace Unix-only shell commands with cross-platform Node.js hooks#12unRekable wants to merge 1 commit intoitz4blitz:mainfrom
unRekable wants to merge 1 commit intoitz4blitz:mainfrom
Conversation
- Add phase-tracker.js: Cross-platform Node.js replacement for jq/bash UserPromptSubmit hook - Remove inline Unix shell commands from settings.json: - Removed: npx tsc --noEmit 2>&1 | head -5 (uses Unix head command) - Removed: Complex bash find/grep/sed command for similar docs detection - Removed: if [ -f ... ]; then jq ... bash command for phase tracking - All hooks now use Node.js which works on Windows, macOS, and Linux Fixes UserPromptSubmit hook error on Windows.
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
This PR replaces Unix-only inline shell commands with cross-platform Node.js hooks, fixing Windows compatibility issues.
Problem
Several hooks in
settings.jsonused Unix-only shell commands:npx tsc --noEmit 2>&1 | head -5-headis not available on Windowsfind/grep/sedcommand for similar doc detectionif [ -f ... ]; then jq ...for phase tracking - requiresjqand bashThese caused
UserPromptSubmit hook erroron Windows.Solution
New
bin/hooks/phase-tracker.js: Cross-platform Node.js replacement for the bash/jq phase trackerRemoved Unix-only inline commands from
settings.json:headChanges
if [ -f ... ]; then jq ...node bin/hooks/phase-tracker.jsnpx tsc ... | head -5Testing
node bin/hooks/phase-tracker.js # Exit code: 0 ✅No more
UserPromptSubmit hook erroron Windows.Related
Follow-up to #11 - Additional Windows compatibility fixes for hooks that were missed in the first PR.