chore: refactoring and tests (#12629)

This commit is contained in:
Adam
2026-02-08 05:02:19 -06:00
committed by GitHub
parent 19b1222cd8
commit d1ebe0767c
16 changed files with 744 additions and 113 deletions

View File

@@ -123,9 +123,13 @@ export namespace Ripgrep {
)
const state = lazy(async () => {
let filepath = Bun.which("rg")
if (filepath) return { filepath }
filepath = path.join(Global.Path.bin, "rg" + (process.platform === "win32" ? ".exe" : ""))
const system = Bun.which("rg")
if (system) {
const stat = await fs.stat(system).catch(() => undefined)
if (stat?.isFile()) return { filepath: system }
log.warn("bun.which returned invalid rg path", { filepath: system })
}
const filepath = path.join(Global.Path.bin, "rg" + (process.platform === "win32" ? ".exe" : ""))
const file = Bun.file(filepath)
if (!(await file.exists())) {