Skip to content

Commit

Permalink
build: hack node-ios-device not to download node 0.10.x binaries on a…
Browse files Browse the repository at this point in the history
…rm64
  • Loading branch information
sgtcoolguy committed Dec 15, 2020
1 parent 24c8cf1 commit 05514c0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions build/lib/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,20 @@ class Packager {
// Now include all the pre-built node-ios-device bindings/binaries
if (this.targetOS === 'osx') {
let dir = path.join(this.zipSDKDir, 'node_modules/node-ios-device');
if (!await fs.exists(dir)) {
if (!await fs.pathExists(dir)) {
dir = path.join(this.zipSDKDir, 'node_modules/ioslib/node_modules/node-ios-device');
}

if (!await fs.exists(dir)) {
if (!await fs.pathExists(dir)) {
throw new Error('Unable to find node-ios-device module');
}
// Hack to remove the super old node 0.10 entry for apple arm64
if (process.arch === 'arm64') {
const nodeIOSDevicePackageJSON = path.join(dir, 'package.json');
const original = await fs.readJSON(nodeIOSDevicePackageJSON);
delete original.binary.targets['0.10.48'];
await fs.writeJSON(nodeIOSDevicePackageJSON, original);
}

await exec('node bin/download-all.js', { cwd: dir, stdio: 'inherit' });
}
Expand Down

0 comments on commit 05514c0

Please sign in to comment.