Skip to content

Commit

Permalink
fix(misc): handle standalone repos when removing nested projects (#15609
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 636a74b)
  • Loading branch information
FrozenPandaz committed Mar 15, 2023
1 parent f32eee9 commit cb5b5b2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,25 @@ describe('checkProjectIsSafeToRemove', () => {
);
}).toThrow();
});

it('should be able to remove e2e project in standalone', () => {
addProjectConfiguration(tree, 'e2e', {
root: 'e2e',
});
addProjectConfiguration(tree, 'root', {
root: '.',
});

expect(() => {
checkProjectIsSafeToRemove(
tree,
{
projectName: 'e2e',
forceRemove: false,
skipFormat: false,
},
readProjectConfiguration(tree, 'e2e')
);
}).not.toThrow();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function checkProjectIsSafeToRemove(
for (const [_, p] of getProjects(tree)) {
if (
project.name !== p.name &&
!normalizePath(relative(project.root, p.root)).startsWith('../')
!normalizePath(relative(project.root, p.root)).startsWith('..')
) {
containedProjects.push(p.name);
}
Expand Down

0 comments on commit cb5b5b2

Please sign in to comment.