fix: add system PATH fallback for ripgrep resolution (#26777) (#26868)

This commit is contained in:
Coco Sheng
2026-05-13 17:05:37 -04:00
committed by GitHub
parent 41599ce29f
commit 0750b01fe4
11 changed files with 573 additions and 366 deletions

View File

@@ -7,7 +7,7 @@
import { mkdir, readdir, rm } from 'node:fs/promises';
import { join, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import { canUseRipgrep } from '../packages/core/src/tools/ripGrep.js';
import { resolveRipgrepPath } from '../packages/core/src/tools/ripGrep.js';
const __dirname = dirname(fileURLToPath(import.meta.url));
const rootDir = join(__dirname, '..');
@@ -27,7 +27,7 @@ export async function setup() {
process.env['GEMINI_CONFIG_DIR'] = join(runDir, '.gemini');
// Download ripgrep to avoid race conditions
const available = await canUseRipgrep();
const available = await resolveRipgrepPath();
if (!available) {
throw new Error('Failed to download ripgrep binary');
}