From d4afba992fee66e28edc98505b774901013c6307 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 14 May 2020 17:08:58 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20#85=20-=20Use=20the=20def?= =?UTF-8?q?ault=20list=20of=20ignore=20patterns=20only=20for=20workspace?= =?UTF-8?q?=20type=20"recursive"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/package.ts | 3 +-- src/workspace.ts | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/package.ts b/src/package.ts index e61666a3..9ed3d70d 100644 --- a/src/package.ts +++ b/src/package.ts @@ -35,8 +35,7 @@ export async function findPackages( const fastGlob = (await import("fast-glob")).default if (!options) options = {} - if (!options.ignore) options.ignore = [] - options.ignore.push(...DEFAULT_IGNORE) + if (!options.ignore) options.ignore = DEFAULT_IGNORE if (options.includeRoot) patterns.push(".") diff --git a/src/workspace.ts b/src/workspace.ts index 153af2d4..6154cb85 100644 --- a/src/workspace.ts +++ b/src/workspace.ts @@ -76,7 +76,10 @@ export class Workspace { if (info) { if (options.includeRoot) info.patterns.push(".") const packages = ( - await findPackages(info.patterns, { cwd: info.root }) + await findPackages(info.patterns, { + cwd: info.root, + ignore: type == WorkspaceProviderType.recursive ? undefined : [], + }) ).map((p) => getPackage(p)) as PackageJsonWithRoot[] return new Workspace(info.root, packages, type) }