fix(tool): fix ripgrep invocation on Windows

On Windows, the path to rg.exe will contain backslashes (e.g.
"C:\ProgramData\chocolatey\bin\rg.exe"). This breaks our invocation
because the \ characters are interpreted specially by Bun's shell. Fix
this problem by escaping the path.

This patch fixes the tool.glob > basic test on Windows.
This commit is contained in:
Matthew Glazar 2025-07-04 23:46:13 -04:00
parent ea6bfef21a
commit b195a29ffe

View file

@ -200,7 +200,7 @@ export namespace Ripgrep {
limit?: number
}) {
const commands = [
`${await filepath()} --files --hidden --glob='!.git/*' ${input.glob ? `--glob='${input.glob}'` : ``}`,
`${$.escape(await filepath())} --files --hidden --glob='!.git/*' ${input.glob ? `--glob='${input.glob}'` : ``}`,
]
if (input.query)
commands.push(`${await Fzf.filepath()} --filter=${input.query}`)