From ba50d3b392133a6eda3a10082223430283662eba Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 23 Dec 2018 11:28:35 +0330 Subject: [PATCH] fix(pkg): skip invalid workspace packages [skip ci] --- scripts/package.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/package.js b/scripts/package.js index 4adf3775d3..23553256c7 100644 --- a/scripts/package.js +++ b/scripts/package.js @@ -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) + } } }