Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): fix permission errors for ES5 bun…
Browse files Browse the repository at this point in the history
…dles

copyFilesSync will also copy permissions which may result in permissions errors.

Closes #15490
  • Loading branch information
alan-agius4 authored and vikerman committed Sep 4, 2019
1 parent 60dd06c commit df6199e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/angular_devkit/build_angular/src/browser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,11 @@ export function buildWebpackBrowser(

for (const action of cacheActions) {
fs.copyFileSync(action.src, action.dest, fs.constants.COPYFILE_FICLONE);
if (process.platform !== 'win32') {
// The cache writes entries as readonly and when using copyFile the permissions will also be copied.
// See: https://github.com/npm/cacache/blob/073fbe1a9f789ba42d9a41de7b8429c93cf61579/lib/util/move-file.js#L36
fs.chmodSync(action.dest, 0o644);
}
}

if (processActions.length > 0) {
Expand Down

0 comments on commit df6199e

Please sign in to comment.