fix(win32): Missing LSP can now unzip on windows (#5594)

This commit is contained in:
Luke Parker
2025-12-16 09:29:30 +10:00
committed by GitHub
parent 002db3abf4
commit 0d1c6e0ca9
2 changed files with 36 additions and 12 deletions

View File

@@ -0,0 +1,16 @@
import { $ } from "bun"
import path from "path"
export namespace Archive {
export async function extractZip(zipPath: string, destDir: string) {
if (process.platform === "win32") {
const winZipPath = path.resolve(zipPath)
const winDestDir = path.resolve(destDir)
// $global:ProgressPreference suppresses PowerShell's blue progress bar popup
const cmd = `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path '${winZipPath}' -DestinationPath '${winDestDir}' -Force`
await $`powershell -NoProfile -NonInteractive -Command ${cmd}`.quiet()
} else {
await $`unzip -o -q ${zipPath} -d ${destDir}`.quiet()
}
}
}