Fix release script to ignore empty package folders

This commit is contained in:
Dan Abramov 2019-12-16 19:16:55 +00:00
parent f42431abe1
commit 7c21bf72ac
1 changed files with 11 additions and 4 deletions

View File

@ -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;