MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / buildRipgrepCommand

Function buildRipgrepCommand

packages/web/tools/globToRegexpPlayground.ts:24–29  ·  view source on GitHub ↗
({ pattern, path, include }: SearchInput)

Source from the content-addressed store, hash-verified

22}
23
24function buildRipgrepCommand({ pattern, path, include }: SearchInput): string {
25 const parts = ['rg', `"${pattern.replace(/"/g, '\\"')}"`];
26 if (path) parts.push(path);
27 if (include) parts.push(`--glob "${include}"`);
28 return parts.join(' ');
29}
30
31function buildZoektQuery({ pattern, path, include }: SearchInput): string {
32 const parts: string[] = [`"${pattern.replace(/"/g, '\\"')}"`];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected