MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / hasRipgrep

Function hasRipgrep

src/utils/ripgrep.ts:16–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14
15/** Cached check for whether the `rg` binary is callable. */
16export async function hasRipgrep(): Promise<boolean> {
17 if (ripgrepAvailable !== null) return ripgrepAvailable;
18 return new Promise((resolve) => {
19 let proc;
20 try {
21 proc = spawn('rg', ['--version'], { stdio: 'ignore' });
22 } catch {
23 ripgrepAvailable = false;
24 resolve(false);
25 return;
26 }
27 proc.on('close', (code) => { ripgrepAvailable = code === 0; resolve(ripgrepAvailable); });
28 proc.on('error', () => { ripgrepAvailable = false; resolve(false); });
29 });
30}
31
32/** Test hook: force the availability cache (pass `null` to clear and re-probe). */
33export function __setRipgrepAvailable(v: boolean | null): void {

Callers 3

index.tsFile · 0.85
executeMethod · 0.85
runLineSearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected