Skip to content

Commit

Permalink
Fix release script to ignore empty package folders
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Dec 16, 2019
1 parent f42431a commit 7c21bf7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/release/utils.js
Expand Up @@ -128,10 +128,17 @@ const getPublicPackages = () => {

const packagePath = join(packagesRoot, dir, 'package.json');

if (dir.charAt(0) !== '.' && statSync(packagePath).isFile()) {
const packageJSON = JSON.parse(readFileSync(packagePath));

return packageJSON.private !== true;
if (dir.charAt(0) !== '.') {
let stat;
try {
stat = statSync(packagePath);
} catch (err) {
return false;
}
if (stat.isFile()) {
const packageJSON = JSON.parse(readFileSync(packagePath));
return packageJSON.private !== true;
}
}

return false;
Expand Down

0 comments on commit 7c21bf7

Please sign in to comment.