Skip to content

Commit 08c1c79

Browse files
committed
fixup! fix(@angular/build): use isSubDirectory in normalizeAssetPatterns and ignore nested .gitkeep
1 parent b0d0c6f commit 08c1c79

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎packages/angular/build/src/utils/resolve-assets.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ import { isSubDirectory } from './path';
1717
*/
1818
export const DEFAULT_ASSET_IGNORE = ['**/.gitkeep', '**/.DS_Store', '**/Thumbs.db'] as const;
1919

20-
function resolveDestination(output: string, file: string, flatten?: boolean): string {
21-
const destination = path.join(output, flatten ? path.basename(file) : file);
22-
if (
23-
path.isAbsolute(destination) ||
24-
destination === '..' ||
25-
destination.startsWith(`..${path.sep}`)
26-
) {
20+
function resolveDestination(output: string, filePath: string, flatten?: boolean): string {
21+
const destination = path.join(output, flatten ? path.basename(filePath) : filePath);
22+
if (destination === '..' || destination.startsWith(`..${path.sep}`)) {
2723
throw new Error('An asset cannot be written to a location outside of the output path.');
2824
}
2925

0 commit comments

Comments
 (0)