diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/cli/cmd/tui/thread.ts | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/packages/opencode/src/cli/cmd/tui/thread.ts b/packages/opencode/src/cli/cmd/tui/thread.ts index 89d61d0f3..79638c5e8 100644 --- a/packages/opencode/src/cli/cmd/tui/thread.ts +++ b/packages/opencode/src/cli/cmd/tui/thread.ts @@ -58,16 +58,14 @@ export const TuiThreadCommand = cmd({ // Resolve relative paths against PWD to preserve behavior when using --cwd flag const baseCwd = process.env.PWD ?? process.cwd() const cwd = args.project ? path.resolve(baseCwd, args.project) : process.cwd() - const defaultWorker = new URL("./worker.ts", import.meta.url) - // Nix build creates a bundled worker next to the binary; prefer it when present. + const localWorker = new URL("./worker.ts", import.meta.url) + const distWorker = new URL("./cli/cmd/tui/worker.js", import.meta.url) const execDir = path.dirname(process.execPath) - const bundledWorker = path.join(execDir, "opencode-worker.js") - const hasBundledWorker = await Bun.file(bundledWorker).exists() - const workerPath = (() => { + const workerPath = await iife(async () => { if (typeof OPENCODE_WORKER_PATH !== "undefined") return OPENCODE_WORKER_PATH - if (hasBundledWorker) return bundledWorker - return defaultWorker - })() + if (await Bun.file(distWorker).exists()) return distWorker + return localWorker + }) try { process.chdir(cwd) } catch (e) { |
