@@ -15,9 +15,14 @@ const bunTargets: Record<string, [string, string]> = {
1515
1616const root = path . join ( import . meta. dirname , ".." ) ;
1717
18- async function prebuild ( cwd : string , platform ?: string , arch ?: string ) {
18+ async function prebuild (
19+ cwd : string ,
20+ platform : string = process . platform ,
21+ arch : string = process . arch ,
22+ ) {
23+ console . log ( "prebuild" , cwd , "for" , platform , arch ) ;
1924 const binary = path . join ( root , "node_modules" , ".bin" , "prebuild-install" ) ;
20- await $ `${ process . execPath } ${ binary } -r napi --arch ${ arch || process . arch } --platform ${ platform || process . platform } ` . cwd (
25+ await $ `${ process . execPath } ${ binary } -r napi --arch ${ arch } --platform ${ platform } ` . cwd (
2126 cwd ,
2227 ) ;
2328}
@@ -41,7 +46,8 @@ async function pack(dst: string, ...inputs: string[]) {
4146
4247 for ( const src of inputs ) {
4348 for await ( const file of glob . scan ( src ) ) {
44- files [ file ] = Bun . file ( `${ src } /${ file } ` ) ;
49+ const name = `./${ src } /${ file } ` ;
50+ files [ name ] = Bun . file ( name ) ;
4551 }
4652 }
4753
@@ -75,8 +81,6 @@ async function main() {
7581
7682 if ( cross ) {
7783 for ( const [ target , [ platform , arch ] ] of Object . entries ( bunTargets ) ) {
78- console . log ( "install prebuild for:" , target , platform , arch ) ;
79-
8084 await prebuild ( cwd , platform , arch ) ;
8185 await bunBuild ( target ) ;
8286 }
0 commit comments