From fb63fd79a3567f5e2dbe398dd4b2e67a64f69df7 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 11 Mar 2026 14:29:35 -0400 Subject: [PATCH] cleanup --- packages/opencode/src/bun/index.ts | 40 --------------------------- packages/opencode/src/bun/registry.ts | 32 --------------------- 2 files changed, 72 deletions(-) delete mode 100644 packages/opencode/src/bun/index.ts delete mode 100644 packages/opencode/src/bun/registry.ts diff --git a/packages/opencode/src/bun/index.ts b/packages/opencode/src/bun/index.ts deleted file mode 100644 index b484676e53..0000000000 --- a/packages/opencode/src/bun/index.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { Log } from "../util/log" -import { text } from "node:stream/consumers" -import { Process } from "../util/process" - -export namespace BunProc { - const log = Log.create({ service: "bun" }) - - export async function run(cmd: string[], options?: Process.Options) { - log.info("running", { - cmd: [which(), ...cmd], - ...options, - }) - const result = Process.spawn([which(), ...cmd], { - ...options, - stdout: "pipe", - stderr: "pipe", - env: { - ...process.env, - ...options?.env, - BUN_BE_BUN: "1", - }, - }) - const code = await result.exited - const stdout = result.stdout ? await text(result.stdout) : undefined - const stderr = result.stderr ? await text(result.stderr) : undefined - log.info("done", { - code, - stdout, - stderr, - }) - if (code !== 0) { - throw new Error(`Command failed with exit code ${code}`) - } - return result - } - - export function which() { - return process.execPath - } -} diff --git a/packages/opencode/src/bun/registry.ts b/packages/opencode/src/bun/registry.ts deleted file mode 100644 index 56d11caec6..0000000000 --- a/packages/opencode/src/bun/registry.ts +++ /dev/null @@ -1,32 +0,0 @@ -import semver from "semver" -import { text } from "node:stream/consumers" -import { Log } from "../util/log" -import { Process } from "../util/process" - -export namespace PackageRegistry { - const log = Log.create({ service: "bun" }) - - function which() { - return process.execPath - } - - export async function info(pkg: string, field: string, cwd?: string): Promise { - const { code, stdout, stderr } = await Process.run([which(), "info", pkg, field], { - cwd, - env: { - ...process.env, - BUN_BE_BUN: "1", - }, - nothrow: true, - }) - - if (code !== 0) { - log.warn("bun info failed", { pkg, field, code, stderr: stderr.toString() }) - return null - } - - const value = stdout.toString().trim() - if (!value) return null - return value - } -}