fix: replace dispatch.sh with direct node command for Windows compatibility#70
fix: replace dispatch.sh with direct node command for Windows compatibility#70abeshbh wants to merge 1 commit into
Conversation
…bility
On Windows, child_process.spawn() without shell:true cannot execute
.sh scripts. dispatch.sh is a runtime detector that tries node first,
then falls back to python. Since Claude Code requires Node.js, node
is always available -- the Python fallback is unnecessary.
Replace ./hooks/dispatch.sh with:
node "${CLAUDE_PLUGIN_ROOT}/hooks/validator.mjs"
This uses the same validator.mjs that dispatch.sh calls, just without
the bash wrapper. Works on all platforms (Mac, Linux, Windows).
Affected plugins: sap-cap-capire, sap-datasphere, sap-sac-custom-widget,
sap-sac-planning, sap-sac-scripting, sap-sqlscript, sapui5
Fixes: Windows spawn ENOENT for hook scripts
Related: anthropics/claude-code#19658, anthropics/claude-code#27061
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
WalkthroughSeven SAP plugins' hook configuration files are updated to invoke a centralized Node.js validator module ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Node.js is not always available if claude code is used. actually, the recommended installation method is the bun native installer, which doesnt need installed node.js Will see what we can do with this regarding windows. |
Summary
child_process.spawn()withoutshell: truecannot execute.shscripts, so./hooks/dispatch.shfails withENOENTdispatch.shis a runtime detector that tries node, then falls back to python3/python/py./hooks/dispatch.shwithnode "${CLAUDE_PLUGIN_ROOT}/hooks/validator.mjs"in all 7 affected pluginsThis calls the same
validator.mjsthatdispatch.shwas calling, just without the bash wrapper. Works on all platforms -- Mac and Linux are unaffected sincenodeis in PATH there too.Affected plugins
Related issues
Test plan
${CLAUDE_PLUGIN_ROOT}resolves correctly)Summary by CodeRabbit