Skip to content

Commit

Permalink
Merge branch 'addon_build' into addon-images
Browse files Browse the repository at this point in the history
  • Loading branch information
jerch committed Oct 25, 2019
2 parents 912ccb3 + 6f8cbc5 commit 9540037
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bin/install-addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ if (fs.existsSync(addonsPath)) {
const addonPath = path.join(addonsPath, folder);

// install only if there are dependencies listed
const packageJson = require(path.join(addonPath, 'package.json'));
if ((packageJson.devDependencies && Object.keys(packageJson.devDependencies).length)
|| (packageJson.dependencies && Object.keys(packageJson.dependencies).length))
// also skip addon if it does not contain any package.json
// (might happen after branch switches)
let packageJson;
try {
packageJson = require(path.join(addonPath, 'package.json'));
} catch (e) {}
if (packageJson
&& (
(packageJson.devDependencies && Object.keys(packageJson.devDependencies).length)
|| (packageJson.dependencies && Object.keys(packageJson.dependencies).length)
)
)
{
console.log('Preparing', folder);
if (hasYarn) {
Expand Down

0 comments on commit 9540037

Please sign in to comment.