diff --git a/packages/opencode/src/lsp/server.ts b/packages/opencode/src/lsp/server.ts index f4554ae3e6..769880ef03 100644 --- a/packages/opencode/src/lsp/server.ts +++ b/packages/opencode/src/lsp/server.ts @@ -8,7 +8,7 @@ import fs from "fs/promises" import { Filesystem } from "../util/filesystem" import { Instance } from "../project/instance" import { Flag } from "../flag/flag" -import { Archive } from "../util/archive" +import { Archive } from "../util" import { Process } from "../util/process" import { which } from "../util/which" import { Module } from "@opencode-ai/shared/util/module" diff --git a/packages/opencode/src/util/archive.ts b/packages/opencode/src/util/archive.ts index f65ceba547..cf25636841 100644 --- a/packages/opencode/src/util/archive.ts +++ b/packages/opencode/src/util/archive.ts @@ -1,17 +1,15 @@ import path from "path" import { Process } from "./process" -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 Process.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", cmd]) - return - } - - await Process.run(["unzip", "-o", "-q", zipPath, "-d", destDir]) +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 Process.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", cmd]) + return } + + await Process.run(["unzip", "-o", "-q", zipPath, "-d", destDir]) } diff --git a/packages/opencode/src/util/index.ts b/packages/opencode/src/util/index.ts new file mode 100644 index 0000000000..157bb8e521 --- /dev/null +++ b/packages/opencode/src/util/index.ts @@ -0,0 +1 @@ +export * as Archive from "./archive"