Skip to content

Commit b0d0c6f

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

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export const DEFAULT_ASSET_IGNORE = ['**/.gitkeep', '**/.DS_Store', '**/Thumbs.d
1919

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

0 commit comments

Comments
 (0)