Skip to content

fix: make prepare script cross-platform so npm install works on Windows - #779

Open
sv789 wants to merge 1 commit into
tobi:mainfrom
sv789:fix/windows-prepare-script
Open

fix: make prepare script cross-platform so npm install works on Windows#779
sv789 wants to merge 1 commit into
tobi:mainfrom
sv789:fix/windows-prepare-script

Conversation

@sv789

@sv789 sv789 commented Jul 20, 2026

Copy link
Copy Markdown

Fixes #778.

prepare was [ -d .git ] && ./scripts/install-hooks.sh || true, which cmd.exe can't run — npm install from a git checkout fails on Windows before completing ('[' is not recognized as an internal or external command).

This ports scripts/install-hooks.sh to a cross-platform scripts/install-hooks.mjs (same behavior: copy scripts/pre-push into .git/hooks, skip when not in a git checkout) and points prepare at it. The now-unused .sh is removed.

Verified on Windows 11 / Node v24.16.0: npm install completes, npm run prepare prints Installed git hooks: pre-push, and the hook lands in .git/hooks/. macOS/Linux behavior is unchanged (same copy + chmod).

🤖 Generated with Claude Code

The prepare script used POSIX sh syntax, which fails under npm's
default cmd.exe script shell on Windows and aborts npm install in git
checkouts. Port the hook installer to a Node script.

Fixes tobi#778

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PowderAddicts

PowderAddicts commented Jul 20, 2026 via email

Copy link
Copy Markdown

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.

npm install fails on Windows: prepare script is POSIX-only

2 participants