@@ -45,7 +45,7 @@ type XCframeworkOptions = {
4545 autoLink : boolean ;
4646} ;
4747
48- export function createAppleFramework ( libraryPath : string ) {
48+ export async function createAppleFramework ( libraryPath : string ) {
4949 assert ( fs . existsSync ( libraryPath ) , `Library not found: ${ libraryPath } ` ) ;
5050 // Write a info.plist file to the framework
5151 const libraryName = path . basename ( libraryPath , path . extname ( libraryPath ) ) ;
@@ -54,11 +54,11 @@ export function createAppleFramework(libraryPath: string) {
5454 `${ libraryName } .framework` ,
5555 ) ;
5656 // Create the framework from scratch
57- fs . rmSync ( frameworkPath , { recursive : true , force : true } ) ;
58- fs . mkdirSync ( frameworkPath ) ;
59- fs . mkdirSync ( path . join ( frameworkPath , "Headers" ) ) ;
57+ await fs . promises . rm ( frameworkPath , { recursive : true , force : true } ) ;
58+ await fs . promises . mkdir ( frameworkPath ) ;
59+ await fs . promises . mkdir ( path . join ( frameworkPath , "Headers" ) ) ;
6060 // Create an empty Info.plist file
61- fs . writeFileSync (
61+ await fs . promises . writeFile (
6262 path . join ( frameworkPath , "Info.plist" ) ,
6363 createPlistContent ( {
6464 CFBundleDevelopmentRegion : "en" ,
@@ -75,8 +75,9 @@ export function createAppleFramework(libraryPath: string) {
7575 ) ;
7676 const newLibraryPath = path . join ( frameworkPath , libraryName ) ;
7777 // TODO: Consider copying the library instead of renaming it
78- fs . renameSync ( libraryPath , newLibraryPath ) ;
78+ await fs . promises . rename ( libraryPath , newLibraryPath ) ;
7979 // Update the name of the library
80+ // TODO: Make this call async
8081 cp . spawnSync ( "install_name_tool" , [
8182 "-id" ,
8283 `@rpath/${ libraryName } .framework/${ libraryName } ` ,
0 commit comments