Skip to content

Commit 665a843

Browse files
authored
feat: unwrap Archive namespace to flat exports + barrel (#22722)
1 parent 1508196 commit 665a843

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

packages/opencode/src/lsp/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import fs from "fs/promises"
88
import { Filesystem } from "../util/filesystem"
99
import { Instance } from "../project/instance"
1010
import { Flag } from "../flag/flag"
11-
import { Archive } from "../util/archive"
11+
import { Archive } from "../util"
1212
import { Process } from "../util/process"
1313
import { which } from "../util/which"
1414
import { Module } from "@opencode-ai/shared/util/module"
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
import path from "path"
22
import { Process } from "./process"
33

4-
export namespace Archive {
5-
export async function extractZip(zipPath: string, destDir: string) {
6-
if (process.platform === "win32") {
7-
const winZipPath = path.resolve(zipPath)
8-
const winDestDir = path.resolve(destDir)
9-
// $global:ProgressPreference suppresses PowerShell's blue progress bar popup
10-
const cmd = `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path '${winZipPath}' -DestinationPath '${winDestDir}' -Force`
11-
await Process.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", cmd])
12-
return
13-
}
14-
15-
await Process.run(["unzip", "-o", "-q", zipPath, "-d", destDir])
4+
export async function extractZip(zipPath: string, destDir: string) {
5+
if (process.platform === "win32") {
6+
const winZipPath = path.resolve(zipPath)
7+
const winDestDir = path.resolve(destDir)
8+
// $global:ProgressPreference suppresses PowerShell's blue progress bar popup
9+
const cmd = `$global:ProgressPreference = 'SilentlyContinue'; Expand-Archive -Path '${winZipPath}' -DestinationPath '${winDestDir}' -Force`
10+
await Process.run(["powershell", "-NoProfile", "-NonInteractive", "-Command", cmd])
11+
return
1612
}
13+
14+
await Process.run(["unzip", "-o", "-q", zipPath, "-d", destDir])
1715
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * as Archive from "./archive"

0 commit comments

Comments
 (0)