Skip to content

Commit 828bfce

Browse files
committed
fix: ensure package listing is only valid structures
1 parent d56e700 commit 828bfce

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/plugin-tools/src/utils/workspace.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function setPackageNamesToUpdate(names: Array<string>) {
3535
}
3636

3737
export function getPackageNamesToUpdate(): Array<string> {
38-
return packageNamesToUpdate;
38+
return packageNamesToUpdate ? packageNamesToUpdate.filter(n => n.indexOf('.') === -1) : [];
3939
}
4040

4141
export function updateWorkspaceJson(updates: any) {
@@ -70,7 +70,11 @@ export function sanitizeCollectionArgs(value: string) {
7070
}
7171

7272
export function getAllPackages(tree: Tree) {
73-
return tree.children('packages').sort();
73+
return tree.children('packages').filter(n => {
74+
// only include valid package structures (in case other misc folders are present)
75+
// ignore hidden files in packages folder (ie, .gitkeep)
76+
return tree.exists(`packages/${n}/package.json`) && n.indexOf('.') === -1;
77+
}).sort();
7478
}
7579

7680
export function checkPackages(tree: Tree) {

0 commit comments

Comments
 (0)