File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 1- const native = require ( 'node-gyp-build' ) ( __dirname ) ;
1+ function loadNative ( ) {
2+ const platform = process . platform ;
3+ const arch = process . arch ;
4+
5+ if ( platform === 'darwin' && arch === 'arm64' ) {
6+ return require ( './prebuilds/darwin-arm64/node-hdiffpatch.node' ) ;
7+ }
8+ if ( platform === 'linux' && arch === 'x64' ) {
9+ return require ( './prebuilds/linux-x64/node-hdiffpatch.node' ) ;
10+ }
11+ if ( platform === 'linux' && arch === 'arm64' ) {
12+ return require ( './prebuilds/linux-arm64/node-hdiffpatch.node' ) ;
13+ }
14+
15+ const combo = `${ platform } -${ arch } ` ;
16+ throw new Error (
17+ `Unsupported platform/arch: ${ combo } . ` +
18+ 'No prebuilt binary is available for this platform.'
19+ ) ;
20+ }
21+
22+ const native = loadNative ( ) ;
223
324exports . native = native ;
425
You can’t perform that action at this time.
0 commit comments