Skip to content

Comments

fix: Replace Unix-only shell commands with cross-platform Node.js hooks#12

Closed
unRekable wants to merge 1 commit intoitz4blitz:mainfrom
unRekable:fix/windows-compatibility-hooks
Closed

fix: Replace Unix-only shell commands with cross-platform Node.js hooks#12
unRekable wants to merge 1 commit intoitz4blitz:mainfrom
unRekable:fix/windows-compatibility-hooks

Conversation

@unRekable
Copy link
Contributor

Summary

This PR replaces Unix-only inline shell commands with cross-platform Node.js hooks, fixing Windows compatibility issues.

Problem

Several hooks in settings.json used Unix-only shell commands:

  1. npx tsc --noEmit 2>&1 | head -5 - head is not available on Windows
  2. Complex bash find/grep/sed command for similar doc detection
  3. if [ -f ... ]; then jq ... for phase tracking - requires jq and bash

These caused UserPromptSubmit hook error on Windows.

Solution

  1. New bin/hooks/phase-tracker.js: Cross-platform Node.js replacement for the bash/jq phase tracker

  2. Removed Unix-only inline commands from settings.json:

    • TypeScript check with head
    • Similar doc detection bash script
    • Phase tracker bash/jq command

Changes

Before After
if [ -f ... ]; then jq ... node bin/hooks/phase-tracker.js
npx tsc ... | head -5 Removed (Unix-only)
Complex bash find/grep/sed Removed (Unix-only)

Testing

node bin/hooks/phase-tracker.js
# Exit code: 0 ✅

No more UserPromptSubmit hook error on Windows.

Related

Follow-up to #11 - Additional Windows compatibility fixes for hooks that were missed in the first PR.

- 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.
@unRekable unRekable closed this Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant