Skip to content

fix: guard POSIX hook commands - #655

Open
ousamabenyounes wants to merge 1 commit into
DietrichGebert:mainfrom
ousamabenyounes:fix-posix-hook-root-node-guard
Open

fix: guard POSIX hook commands#655
ousamabenyounes wants to merge 1 commit into
DietrichGebert:mainfrom
ousamabenyounes:fix-posix-hook-root-node-guard

Conversation

@ousamabenyounes

Copy link
Copy Markdown
Contributor

Fixes #646.
Fixes #645.

What changed

  • Normalize backslashed POSIX plugin roots before invoking hook scripts.
  • Guard POSIX hook commands when node is missing or the script path is unavailable.
  • Apply the same POSIX hardening to Copilot bash hooks.
  • Keep Windows-specific commands covered by commandWindows/powershell.

RED

node --test tests/hooks.test.js

Error: Cannot find module .../\home\...\ponytail/hooks/ponytail-activate.js
Tests: 1, Failures: 1

GREEN

node --test tests/hooks.test.js tests/hooks-windows.test.js
# tests 7
# pass 7
npm test --prefix pi-extension
# tests 23
# pass 23

npm test --prefix ponytail-mcp
# tests 3
# pass 3

Full-suite note

node --test tests/*.test.js
# tests 82
# pass 81
# fail 1

The remaining failure is csv: correct pandas one-liner passes; this environment has no pandas installed (ModuleNotFoundError: No module named pandas) and the failure is unrelated to the hook manifest changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant