File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,9 @@ export const platform: Platform<Target[], NodeOpts> = {
9090 . filter (
9191 ( dirent ) =>
9292 dirent . isFile ( ) &&
93- ( dirent . name . endsWith ( ".so" ) || dirent . name . endsWith ( ".node" ) ) ,
93+ ( dirent . name . endsWith ( ".so" ) ||
94+ dirent . name . endsWith ( ".dylib" ) ||
95+ dirent . name . endsWith ( ".node" ) ) ,
9496 )
9597 . map ( ( dirent ) => path . join ( dirent . parentPath , dirent . name ) ) ;
9698 assert . equal ( result . length , 1 , "Expected exactly one library file" ) ;
Original file line number Diff line number Diff line change @@ -50,12 +50,11 @@ export async function createNodeLibsDirectory({
5050 const osArch = DIRECTORY_NAMES_PER_TARGET [ triplet ] ;
5151 const osArchOutputPath = path . join ( outputPath , osArch ) ;
5252 await fs . promises . mkdir ( osArchOutputPath , { recursive : true } ) ;
53- // Strip the ".so" extension from the library name
54- const libraryName = path . basename ( libraryPath , ".so" ) ;
55- const nodeSuffixedName =
56- path . extname ( libraryName ) === ".node"
57- ? libraryName
58- : `${ libraryName } .node` ;
53+ // Strip any extension from the library name and rename it to .node
54+ const libraryName = path
55+ . basename ( libraryPath )
56+ . replaceAll ( / \. s o $ | \. d y l i b $ | \. n o d e $ / g, "" ) ;
57+ const nodeSuffixedName = `${ libraryName } .node` ;
5958 const libraryOutputPath = path . join ( osArchOutputPath , nodeSuffixedName ) ;
6059 await fs . promises . copyFile ( libraryPath , libraryOutputPath ) ;
6160 }
You can’t perform that action at this time.
0 commit comments