Skip to content

Commit a82cf16

Browse files
Ripgrep stability and crash tracking (#275)
* Ripgrep stability and crash tracking * Update src/search-manager.ts Co-authored-by: codeant-ai[bot] <151821869+codeant-ai[bot]@users.noreply.github.com> * Update src/npm-scripts/verify-ripgrep.ts Co-authored-by: codeant-ai[bot] <151821869+codeant-ai[bot]@users.noreply.github.com> --------- Co-authored-by: codeant-ai[bot] <151821869+codeant-ai[bot]@users.noreply.github.com>
1 parent 727dfd4 commit a82cf16

File tree

7 files changed

+133
-288
lines changed

7 files changed

+133
-288
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"testemonials"
2323
],
2424
"scripts": {
25-
"postinstall": "node dist/track-installation.js",
25+
"postinstall": "node dist/track-installation.js && node dist/npm-scripts/verify-ripgrep.js || true",
2626
"open-chat": "open -n /Applications/Claude.app",
2727
"sync-version": "node scripts/sync-version.js",
2828
"bump": "node scripts/sync-version.js --bump",

src/npm-scripts/verify-ripgrep.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env node
2+
3+
/**
4+
* Verify ripgrep binary availability after installation
5+
* This runs after npm install to warn users if ripgrep is not available
6+
*/
7+
8+
import { getRipgrepPath } from '../utils/ripgrep-resolver.js';
9+
10+
async function verifyRipgrep() {
11+
try {
12+
const path = await getRipgrepPath();
13+
console.log(`✓ ripgrep found at: ${path}`);
14+
process.exit(0);
15+
} catch (err) {
16+
const message = err instanceof Error ? err.message : String(err);
17+
console.error('⚠ Warning: ripgrep binary not available');
18+
console.error(`${message}`);
19+
console.error('');
20+
console.error('Desktop Commander will not work until ripgrep is available.');
21+
console.error('This usually happens when npm postinstall scripts fail during npx execution.');
22+
console.error('');
23+
console.error('To fix this, install ripgrep manually:');
24+
console.error(' macOS: brew install ripgrep');
25+
console.error(' Linux: See https://github.com/BurntSushi/ripgrep#installation');
26+
console.error(' Windows: choco install ripgrep or download from https://github.com/BurntSushi/ripgrep/releases');
27+
process.exit(1);
28+
}
29+
}
30+
31+
verifyRipgrep();

src/search-manager.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { spawn, ChildProcess } from 'child_process';
2-
import { rgPath } from '@vscode/ripgrep';
32
import path from 'path';
43
import { validatePath } from './tools/filesystem.js';
54
import { capture } from './utils/capture.js';
5+
import { getRipgrepPath } from './utils/ripgrep-resolver.js';
66

77
export interface SearchResult {
88
file: string;
@@ -69,6 +69,14 @@ export interface SearchSessionOptions {
6969
// Build ripgrep arguments
7070
const args = this.buildRipgrepArgs({ ...options, rootPath: validPath });
7171

72+
// Get ripgrep path with fallback resolution
73+
let rgPath: string;
74+
try {
75+
rgPath = await getRipgrepPath();
76+
} catch (err) {
77+
throw new Error(`Failed to locate ripgrep binary: ${err instanceof Error ? err.message : String(err)}`);
78+
}
79+
7280
// Start ripgrep process
7381
const rgProcess = spawn(rgPath, args);
7482

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
959959
960960
${CMD_PREFIX_DESCRIPTION}`,
961961
inputSchema: zodToJsonSchema(GetPromptsArgsSchema),
962-
},
962+
}
963963
];
964964

965965
// Filter tools based on current client

src/tools/search.ts

Lines changed: 0 additions & 283 deletions
This file was deleted.

0 commit comments

Comments
 (0)