Skip to content

Commit 1f8d396

Browse files
fix(dev): build tui with correct file ext for windows (anomalyco#2590)
1 parent 3752bb9 commit 1f8d396

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • packages/opencode/src/cli/cmd

packages/opencode/src/cli/cmd/tui.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,15 @@ export const TuiCommand = cmd({
123123
const file = Bun.file(binary)
124124
if (!(await file.exists())) {
125125
await Bun.write(file, tui, { mode: 0o755 })
126-
await fs.chmod(binary, 0o755)
126+
if (process.platform !== "win32") await fs.chmod(binary, 0o755)
127127
}
128128
cmd = [binary]
129129
}
130130
if (!tui) {
131131
const dir = Bun.fileURLToPath(new URL("../../../../tui/cmd/opencode", import.meta.url))
132-
await $`go build -o ./dist/tui ./main.go`.cwd(dir)
133-
cmd = [path.join(dir, "dist/tui")]
132+
let binaryName = `./dist/tui${process.platform === "win32" ? ".exe" : ""}`
133+
await $`go build -o ${binaryName} ./main.go`.cwd(dir)
134+
cmd = [path.join(dir, binaryName)]
134135
}
135136
Log.Default.info("tui", {
136137
cmd,

0 commit comments

Comments
 (0)