Fix Windows ripgrep detection (#11492)

This commit is contained in:
cornmander
2025-10-20 19:17:44 -04:00
committed by GitHub
parent cc7e1472f9
commit 31f58a1f04
4 changed files with 174 additions and 75 deletions

View File

@@ -104,7 +104,7 @@ const untarGz = async (inFile, outDir) => {
}
}
export const downloadRipGrep = async () => {
export const downloadRipGrep = async (binPath = BIN_PATH) => {
const target = getTarget()
const url = `https://github.com/${REPOSITORY}/releases/download/${VERSION}/ripgrep-${VERSION}-${target}`
const downloadPath = `${xdgCache}/vscode-ripgrep/ripgrep-${VERSION}-${target}`
@@ -114,9 +114,9 @@ export const downloadRipGrep = async () => {
console.info(`File ${downloadPath} has been cached`)
}
if (downloadPath.endsWith('.tar.gz')) {
await untarGz(downloadPath, BIN_PATH)
await untarGz(downloadPath, binPath)
} else if (downloadPath.endsWith('.zip')) {
await unzip(downloadPath, BIN_PATH)
await unzip(downloadPath, binPath)
} else {
throw new VError(`Invalid downloadPath ${downloadPath}`)
}