The open source coding agent.
TypeScript
fix(dev): build tui with correct file ext for windows (#2590)
Mani Sundararajan1f8d396b76f3
diff --git a/packages/opencode/src/cli/cmd/tui.ts b/packages/opencode/src/cli/cmd/tui.tsindex 86b9f31b8ec..e0fe490192a 100644--- a/packages/opencode/src/cli/cmd/tui.ts+++ b/packages/opencode/src/cli/cmd/tui.ts@@ -123,14 +123,15 @@ export const TuiCommand = cmd({const file = Bun.file(binary)if (!(await file.exists())) {await Bun.write(file, tui, { mode: 0o755 })- await fs.chmod(binary, 0o755)+ if (process.platform !== "win32") await fs.chmod(binary, 0o755)}cmd = [binary]}if (!tui) {const dir = Bun.fileURLToPath(new URL("../../../../tui/cmd/opencode", import.meta.url))- await $`go build -o ./dist/tui ./main.go`.cwd(dir)- cmd = [path.join(dir, "dist/tui")]+ let binaryName = `./dist/tui${process.platform === "win32" ? ".exe" : ""}`+ await $`go build -o ${binaryName} ./main.go`.cwd(dir)+ cmd = [path.join(dir, binaryName)]}Log.Default.info("tui", {cmd,