fix: make prepare script cross-platform so npm install works on Windows - #779
Open
sv789 wants to merge 1 commit into
Open
fix: make prepare script cross-platform so npm install works on Windows#779sv789 wants to merge 1 commit into
sv789 wants to merge 1 commit into
Conversation
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>
|
Dear tobi/qmd,
We would like to acknowledge that we have received your request and a ticket has been created.
A support representative will be reviewing your request and will send you a personal response.(usually within 24-48 hours).
Thank you for your patience.
…On Mon, Jul 20 2026, at 02:48 PM, tobi/qmd ***@***.***> wrote:
Fixes #778. (#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 (https://claude.com/claude-code) You can view, comment on, or merge this pull request online at: #779 (#779) Commit Summary 05ee716 fix: make prepare script cross-platform so npm install works on Windows (05ee716) File Changes
( 3 files) (https://github.com/tobi/qmd/pull/779/files) M package.json
(2) (https://github.com/tobi/qmd/pull/779/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519) A scripts/install-hooks.mjs
(18) (https://github.com/tobi/qmd/pull/779/files#diff-a7ce0f645252b5b37ca92f730a1c35962b74b4d1f9421880f47fc690db622c72) D scripts/install-hooks.sh
(19) (https://github.com/tobi/qmd/pull/779/files#diff-0dadfcacd7c7ff77588c863d857430870295b5aafb288526bc30239754ca573b) Patch Links: https://github.com/tobi/qmd/pull/779.patch (https://github.com/tobi/qmd/pull/779.patch) https://github.com/tobi/qmd/pull/779.diff (https://github.com/tobi/qmd/pull/779.diff)
—
Reply to this email directly, view it on GitHub, or (#779?email_source=notifications&email_token=BRF3HG37K6BNW7FMX2KNCUT5FYWNNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DAOJSGAZDINZXG2THEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW) unsubscribe. (https://github.com/notifications/unsubscribe-auth/BRF3HG2KLROHIQB53CZIOG35FYWNNAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMJSGM3DKMZQGE5US43TOVSTWNBZGMYDAOJWGQ4DDILWAI)
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and (https://github.com/notifications/mobile/ios/BRF3HG45C3R3GDXOO4MPP3T5FYWNNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DAOJSGAZDINZXG2THEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVJTG633UMVZF62LPOM) Android. Download it today! (https://github.com/notifications/mobile/android/BRF3HG5P72ZWNBQSGS7HBTT5FYWNNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DAOJSGAZDINZXG2THEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE)
You are receiving this because you are subscribed to this thread. Message ID: <tobi/qmd/pull/779 @ github . com> [
{
***@***.***": "http://schema.org",
***@***.***": "EmailMessage",
"potentialAction": {
***@***.***": "ViewAction",
"target": "#779?email_source=notifications\u0026email_token=BRF3HG3SBVSZA2STY4LYEFT5FYWNNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DAOJSGAZDINZXG2THEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVNTW2YLJNRPWG3DJMNVQ",
"url": "#779?email_source=notifications\u0026email_token=BRF3HG3SBVSZA2STY4LYEFT5FYWNNA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DAOJSGAZDINZXG2THEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVNTW2YLJNRPWG3DJMNVQ",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
***@***.***": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]
|
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.
Fixes #778.
preparewas[ -d .git ] && ./scripts/install-hooks.sh || true, which cmd.exe can't run —npm installfrom a git checkout fails on Windows before completing ('[' is not recognized as an internal or external command).This ports
scripts/install-hooks.shto a cross-platformscripts/install-hooks.mjs(same behavior: copyscripts/pre-pushinto.git/hooks, skip when not in a git checkout) and pointsprepareat it. The now-unused.shis removed.Verified on Windows 11 / Node v24.16.0:
npm installcompletes,npm run prepareprintsInstalled git hooks: pre-push, and the hook lands in.git/hooks/. macOS/Linux behavior is unchanged (same copy + chmod).🤖 Generated with Claude Code