File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,15 @@ import { fileURLToPath } from "url"
88const __filename = fileURLToPath ( import . meta. url )
99const __dirname = path . dirname ( __filename )
1010const dir = path . resolve ( __dirname , ".." )
11+ const root = path . resolve ( dir , "../.." )
12+
13+ function linker ( ) : "hoisted" | "isolated" {
14+ // jsonc-parser is only declared in packages/opencode, so its install location
15+ // tells us whether Bun used a hoisted or isolated workspace layout.
16+ if ( fs . existsSync ( path . join ( dir , "node_modules" , "jsonc-parser" ) ) ) return "isolated"
17+ if ( fs . existsSync ( path . join ( root , "node_modules" , "jsonc-parser" ) ) ) return "hoisted"
18+ throw new Error ( "Could not detect Bun linker from jsonc-parser" )
19+ }
1120
1221process . chdir ( dir )
1322
@@ -41,7 +50,9 @@ const migrations = await Promise.all(
4150)
4251console . log ( `Loaded ${ migrations . length } migrations` )
4352
44- await $ `bun install --os="*" --cpu="*" @lydell/node-pty@1.2.0-beta.10`
53+ const link = linker ( )
54+
55+ await $ `bun install --linker=${ link } --os="*" --cpu="*" @lydell/node-pty@1.2.0-beta.10`
4556
4657await Bun . build ( {
4758 target : "node" ,
You can’t perform that action at this time.
0 commit comments