Skip to content

Commit b2fbdad

Browse files
committed
fix: Windows build compatibility
- Use 'where' instead of 'which' on Windows for ripgrep detection - Replace '|| true' with cross-platform fallback in postinstall - Add --include=dev to setup script for NODE_ENV=production environments
1 parent 6b3b7e5 commit b2fbdad

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"testemonials"
2323
],
2424
"scripts": {
25-
"postinstall": "node dist/track-installation.js && node dist/npm-scripts/verify-ripgrep.js || true",
25+
"postinstall": "node dist/track-installation.js && node dist/npm-scripts/verify-ripgrep.js || node -e \"process.exit(0)\"",
2626
"open-chat": "open -n /Applications/Claude.app",
2727
"sync-version": "node scripts/sync-version.js",
2828
"bump": "node scripts/sync-version.js --bump",
@@ -32,7 +32,7 @@
3232
"watch": "tsc --watch",
3333
"start": "node dist/index.js",
3434
"start:debug": "node --inspect-brk=9229 dist/index.js",
35-
"setup": "npm install && npm run build && node setup-claude-server.js",
35+
"setup": "npm install --include=dev && npm run build && node setup-claude-server.js",
3636
"setup:debug": "npm install && npm run build && node setup-claude-server.js --debug",
3737
"remove": "npm install && npm run build && node uninstall-claude-server.js",
3838
"prepare": "npm run build",

src/utils/ripgrep-resolver.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ export async function getRipgrepPath(): Promise<string> {
3333
// @vscode/ripgrep import or binary resolution failed, continue to fallbacks
3434
}
3535

36-
// Strategy 2: Try system ripgrep using 'which' command
36+
// Strategy 2: Try system ripgrep using 'which' (Unix) or 'where' (Windows)
3737
try {
3838
const systemRg = process.platform === 'win32' ? 'rg.exe' : 'rg';
39-
const result = execSync(`which ${systemRg}`, { encoding: 'utf-8' }).trim();
39+
const whichCmd = process.platform === 'win32' ? 'where' : 'which';
40+
const result = execSync(`${whichCmd} ${systemRg}`, { encoding: 'utf-8' }).trim().split(/\r?\n/)[0];
4041
if (result && existsSync(result)) {
4142
cachedRgPath = result;
4243
return result;

0 commit comments

Comments
 (0)