@@ -16,6 +16,7 @@ import pkg from "../package.json"
1616import { Script } from "@opencode-ai/script"
1717
1818const singleFlag = process . argv . includes ( "--single" )
19+ const skipInstall = process . argv . includes ( "--skip-install" )
1920
2021const allTargets : {
2122 os : string
@@ -83,8 +84,10 @@ const targets = singleFlag
8384await $ `rm -rf dist`
8485
8586const binaries : Record < string , string > = { }
86- await $ `bun install --os="*" --cpu="*" @opentui/core@${ pkg . dependencies [ "@opentui/core" ] } `
87- await $ `bun install --os="*" --cpu="*" @parcel/watcher@${ pkg . dependencies [ "@parcel/watcher" ] } `
87+ if ( ! skipInstall ) {
88+ await $ `bun install --os="*" --cpu="*" @opentui/core@${ pkg . dependencies [ "@opentui/core" ] } `
89+ await $ `bun install --os="*" --cpu="*" @parcel/watcher@${ pkg . dependencies [ "@parcel/watcher" ] } `
90+ }
8891for ( const item of targets ) {
8992 const name = [
9093 pkg . name ,
@@ -102,6 +105,10 @@ for (const item of targets) {
102105 const parserWorker = fs . realpathSync ( path . resolve ( dir , "./node_modules/@opentui/core/parser.worker.js" ) )
103106 const workerPath = "./src/cli/cmd/tui/worker.ts"
104107
108+ // Use platform-specific bunfs root path based on target OS
109+ const bunfsRoot = item . os === "win32" ? "B:/~BUN/root/" : "/$bunfs/root/"
110+ const workerRelativePath = path . relative ( dir , parserWorker ) . replaceAll ( "\\" , "/" )
111+
105112 await Bun . build ( {
106113 conditions : [ "browser" ] ,
107114 tsconfig : "./tsconfig.json" ,
@@ -118,7 +125,7 @@ for (const item of targets) {
118125 entrypoints : [ "./src/index.ts" , parserWorker , workerPath ] ,
119126 define : {
120127 OPENCODE_VERSION : `'${ Script . version } '` ,
121- OTUI_TREE_SITTER_WORKER_PATH : "/$bunfs/root/" + path . relative ( dir , parserWorker ) . replaceAll ( "\\" , "/" ) ,
128+ OTUI_TREE_SITTER_WORKER_PATH : bunfsRoot + workerRelativePath ,
122129 OPENCODE_WORKER_PATH : workerPath ,
123130 OPENCODE_CHANNEL : `'${ Script . channel } '` ,
124131 } ,
0 commit comments