Skip to content

Commit

Permalink
mitigate error in pkg bundling caused by scoped modules
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Feb 29, 2020
1 parent a5ed1e7 commit 05943eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions bundle-pkgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const blacklist = [
'node-red',
'npm',
'ain2',
'node-red-contrib-theme-midnight-red'
'@node-red-contrib-themes/midnight-red'
];

const extraFiles = {
Expand All @@ -28,11 +28,19 @@ const extraFiles = {
const remove = [];
const repo = {};

// TODO handle scoped packages

Object.keys(pkgLib.dependencies).forEach(name => {
if (blacklist.includes(name)) {
return;
}
const pkgJson = require(__dirname + '/addon_tmp/redmatic/lib/node_modules/' + name + '/package.json');
let pkgJson;
try {
pkgJson = require(__dirname + '/addon_tmp/redmatic/lib/node_modules/' + name + '/package.json');
} catch (err) {
console.error(err.message);
return;
}
const {version, description, keywords, homepage, repository} = pkgJson;

const filename = 'redmatic-pkg-' + name + '-' + version + '.tar.gz';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redmatic",
"version": "5.4.0",
"version": "5.4.1",
"description": "Node-RED packaged as Homematic CCU addon",
"repository": "github:rdmtc/redmatic",
"private": true,
Expand Down

0 comments on commit 05943eb

Please sign in to comment.