Skip to content

The open source coding agent.

TypeScript

fix: make build script work cross-platform (#3430)

Joscha Götzer7d0c6860cd52
diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts
index feb91e09bce..b3d6d57ddd4 100755
--- a/packages/opencode/script/build.ts
+++ b/packages/opencode/script/build.ts
@@ -1,6 +1,11 @@
#!/usr/bin/env bun
import path from "path"
-const dir = new URL("..", import.meta.url).pathname
+import { fileURLToPath } from "url"
+
+const __filename = fileURLToPath(import.meta.url)
+const __dirname = path.dirname(__filename)
+const dir = path.resolve(__dirname, "..")
+
process.chdir(dir)
import { $ } from "bun"