summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-11-02 15:41:32 -0500
committerDax Raad <[email protected]>2025-11-02 15:42:15 -0500
commitd1cd7d0344f8de03ab6bf222512d4615cbca7ec4 (patch)
treef67b6721d01e13f857e62cab5990295cf2ad3460 /packages
parent06ac1be226555c1d562a26de9c64dd64e3926275 (diff)
downloadopencode-d1cd7d0344f8de03ab6bf222512d4615cbca7ec4.tar.gz
opencode-d1cd7d0344f8de03ab6bf222512d4615cbca7ec4.zip
ci: centralize Bun version to package.json to ensure consistent builds across CI and local development
Diffstat (limited to 'packages')
-rw-r--r--packages/script/src/index.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/packages/script/src/index.ts b/packages/script/src/index.ts
index 9453c2526..f1f1e4597 100644
--- a/packages/script/src/index.ts
+++ b/packages/script/src/index.ts
@@ -1,7 +1,18 @@
import { $ } from "bun"
+import path from "path"
-if (process.versions.bun !== "1.3.1") {
- throw new Error("This script requires [email protected]")
+const rootPkgPath = path.resolve(import.meta.dir, "../../../package.json")
+const rootPkg = await Bun.file(rootPkgPath).json()
+const expectedBunVersion = rootPkg.packageManager?.split("@")[1]
+
+if (!expectedBunVersion) {
+ throw new Error("packageManager field not found in root package.json")
+}
+
+if (process.versions.bun !== expectedBunVersion) {
+ throw new Error(
+ `This script requires bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`,
+ )
}
const CHANNEL =