fix: improve glob tool Windows compatibility and rg resolution (#309)

This commit is contained in:
Sisyphus
2025-12-29 10:10:22 +09:00
committed by GitHub
parent 55a3a6c9eb
commit 6dd98254be
4 changed files with 71 additions and 14 deletions
+4
View File
@@ -2,6 +2,7 @@ import { existsSync } from "node:fs"
import { join, dirname } from "node:path"
import { spawnSync } from "node:child_process"
import { getInstalledRipgrepPath, downloadAndInstallRipgrep } from "./downloader"
import { getDataDir } from "../../shared/data-path"
export type GrepBackend = "rg" | "grep"
@@ -36,6 +37,9 @@ function getOpenCodeBundledRg(): string | null {
const rgName = isWindows ? "rg.exe" : "rg"
const candidates = [
// OpenCode XDG data path (highest priority - where OpenCode installs rg)
join(getDataDir(), "opencode", "bin", rgName),
// Legacy paths relative to execPath
join(execDir, rgName),
join(execDir, "bin", rgName),
join(execDir, "..", "bin", rgName),