mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-30 05:29:53 +00:00
fix(opencode): Allow compatible Bun versions in packageManager field (#9597)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
parent
7170983ef2
commit
17c4202ea8
5 changed files with 12 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { $ } from "bun"
|
||||
import path from "path"
|
||||
import { satisfies } from "semver"
|
||||
|
||||
const rootPkgPath = path.resolve(import.meta.dir, "../../../package.json")
|
||||
const rootPkg = await Bun.file(rootPkgPath).json()
|
||||
|
|
@ -9,7 +10,7 @@ if (!expectedBunVersion) {
|
|||
throw new Error("packageManager field not found in root package.json")
|
||||
}
|
||||
|
||||
if (process.versions.bun !== expectedBunVersion) {
|
||||
if (!satisfies(process.versions.bun, expectedBunVersion)) {
|
||||
throw new Error(`This script requires bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue