(cwd: string, opts: LineSearchOptions)
| 86 | * `stdout`. When ripgrep is unavailable, transparently uses the JS fallback. |
| 87 | */ |
| 88 | export async function runLineSearch(cwd: string, opts: LineSearchOptions): Promise<LineSearchResult> { |
| 89 | if (await hasRipgrep()) { |
| 90 | return runRipgrep(opts.rgArgs, opts.signal); |
| 91 | } |
| 92 | const stdout = await jsLineSearch(cwd, opts); |
| 93 | return { stdout, usedFallback: true }; |
| 94 | } |
| 95 | |
| 96 | function runRipgrep(rgArgs: string[], signal?: AbortSignal): Promise<LineSearchResult> { |
| 97 | return new Promise((resolve) => { |
no test coverage detected