|
|
@@ -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 =
|