fix(pkg): skip invalid workspace packages

[skip ci]
This commit is contained in:
Pooya Parsa 2018-12-23 11:28:35 +03:30
parent f1377a7f8d
commit ba50d3b392

View File

@ -171,10 +171,12 @@ export default class Package {
for (const workspace of this.pkg.workspaces || []) {
const dirs = await glob(workspace)
for (const dir of dirs) {
const pkg = new Package({
rootDir: this.resolvePath(dir)
})
packages.push(pkg)
if (existsSync(this.resolvePath(dir, 'package.json'))) {
const pkg = new Package({ rootDir: this.resolvePath(dir) })
packages.push(pkg)
} else {
consola.warn('Invalid workspace package:', dir)
}
}
}