Skip to content

Commit a2b1fab

Browse files
committed
fixup! fix(@angular/build): prevent deleting parent directories of project root
1 parent 6c745cc commit a2b1fab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/angular/build/src/utils/delete-output-dir.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export async function deleteOutputDir(
2121
const relativePath = relative(resolvedOutputPath, root);
2222
if (!relativePath || !relativePath.startsWith('..')) {
2323
throw new Error(
24-
`Output path "${resolvedOutputPath}" MUST not be the project root directory or a parent of it.`,
24+
`Output path "${resolvedOutputPath}" MUST not be the project root directory or its parent.`,
2525
);
2626
}
2727

packages/angular/build/src/utils/delete-output-dir_spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ describe('deleteOutputDir', () => {
2020

2121
it('should throw when output path is the project root', async () => {
2222
await expectAsync(deleteOutputDir(root, '.')).toBeRejectedWithError(
23-
/MUST not be the project root directory or a parent of it/,
23+
/MUST not be the project root directory or its parent/,
2424
);
2525
});
2626

2727
it('should throw when output path is a parent of the project root', async () => {
2828
await expectAsync(deleteOutputDir(root, '..')).toBeRejectedWithError(
29-
/MUST not be the project root directory or a parent of it/,
29+
/MUST not be the project root directory or its parent/,
3030
);
3131
});
3232

3333
it('should throw when output path is a grandparent of the project root', async () => {
3434
await expectAsync(deleteOutputDir(root, '../..')).toBeRejectedWithError(
35-
/MUST not be the project root directory or a parent of it/,
35+
/MUST not be the project root directory or its parent/,
3636
);
3737
});
3838

0 commit comments

Comments
 (0)