opentui: fix: Make worker.ts path independent from cwd (#3600)
Some checks failed
snapshot / publish (push) Has been cancelled
test / test (push) Has been cancelled
format / format (push) Has been cancelled

This commit is contained in:
Haris Gušić 2025-10-31 23:35:15 +01:00 committed by GitHub
parent 4a426ab959
commit 553f9ebfe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,7 @@ import { upgrade } from "@/cli/upgrade"
import { Session } from "@/session"
import { bootstrap } from "@/cli/bootstrap"
import path from "path"
import { fileURLToPath } from "url"
import { UI } from "@/cli/ui"
export const TuiThreadCommand = cmd({
@ -78,7 +79,9 @@ export const TuiThreadCommand = cmd({
return undefined
})()
const worker = new Worker("./src/cli/cmd/tui/worker.ts")
const worker = new Worker(
path.join(path.dirname(fileURLToPath(import.meta.url)), "worker.ts"),
)
worker.onerror = console.error
const client = Rpc.client<typeof rpc>(worker)
process.on("uncaughtException", (e) => {