From 4a27b2b38d2562b6fbeb090c581b6437fd2d2c21 Mon Sep 17 00:00:00 2001 From: AgentEnder Date: Fri, 5 May 2023 13:35:26 -0400 Subject: [PATCH] fix(devkit): ensure ignore has been initialized in visitNotIgnoredFiles --- packages/devkit/src/generators/visit-not-ignored-files.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/devkit/src/generators/visit-not-ignored-files.ts b/packages/devkit/src/generators/visit-not-ignored-files.ts index e154dee2b8c35..87a6ea0b7ebce 100644 --- a/packages/devkit/src/generators/visit-not-ignored-files.ts +++ b/packages/devkit/src/generators/visit-not-ignored-files.ts @@ -18,6 +18,7 @@ export function visitNotIgnoredFiles( ig.add(tree.read('.gitignore', 'utf-8')); } if (tree.exists('.nxignore')) { + ig ??= ignore(); ig.add(tree.read('.nxignore', 'utf-8')); } dirPath = normalizePathRelativeToRoot(dirPath, tree.root);