Parcourir la source

refactor: migrate src/cli/cmd/tui/thread.ts from Bun.file() to Filesystem module (#14135)

Dax il y a 2 mois
Parent
commit
6fb4f2a7a5
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      packages/opencode/src/cli/cmd/tui/thread.ts

+ 3 - 1
packages/opencode/src/cli/cmd/tui/thread.ts

@@ -3,10 +3,12 @@ import { tui } from "./app"
 import { Rpc } from "@/util/rpc"
 import { type rpc } from "./worker"
 import path from "path"
+import { fileURLToPath } from "url"
 import { UI } from "@/cli/ui"
 import { iife } from "@/util/iife"
 import { Log } from "@/util/log"
 import { withNetworkOptions, resolveNetworkOptions } from "@/cli/network"
+import { Filesystem } from "@/util/filesystem"
 import type { Event } from "@opencode-ai/sdk/v2"
 import type { EventSource } from "./context/sdk"
 import { win32DisableProcessedInput, win32InstallCtrlCGuard } from "./win32"
@@ -99,7 +101,7 @@ export const TuiThreadCommand = cmd({
       const distWorker = new URL("./cli/cmd/tui/worker.js", import.meta.url)
       const workerPath = await iife(async () => {
         if (typeof OPENCODE_WORKER_PATH !== "undefined") return OPENCODE_WORKER_PATH
-        if (await Bun.file(distWorker).exists()) return distWorker
+        if (await Filesystem.exists(fileURLToPath(distWorker))) return distWorker
         return localWorker
       })
       try {