Skip to content

Commit

Permalink
remove unwanted modules from x86_64 build, catch errors on removal
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Oct 31, 2020
1 parent 36756db commit 77bbbaf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Object.keys(pkgLib.dependencies).forEach(name => {

remove.push(__dirname + '/addon_tmp/redmatic/lib/node_modules/' + name);

if (tarch === 'i686' && name === 'node-red-contrib-johnny-five') {
if ((tarch === 'i686' || tarch === 'x86_64') && name === 'node-red-contrib-johnny-five') {
return;
}

Expand Down Expand Up @@ -93,7 +93,11 @@ remove.forEach(path => {
console.log('remove', path);
if (fs.existsSync(path)) {
if (fs.statSync(path).isDirectory()) {
cp.execSync('rm -r ' + path);
try {
cp.execSync('rm -r ' + path);
} catch (error) {
console.error(error.message);
}
} else {
fs.unlinkSync(path);
}
Expand Down

0 comments on commit 77bbbaf

Please sign in to comment.