Skip to content

Commit

Permalink
Use fs.chmodSync() before preserveTimestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
manidlou committed Nov 11, 2017
1 parent d6f6da1 commit 5d1f2d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/copy-sync/copy-sync.js
Expand Up @@ -102,7 +102,10 @@ function copyFileFallback (srcStat, src, dest, opts) {

fs.closeSync(fdr)
fs.closeSync(fdw)
if (opts.preserveTimestamps) return utimesSync(dest, srcStat.atime, srcStat.mtime)
fs.chmodSync(dest, srcStat.mode)
if (opts.preserveTimestamps) {
return utimesSync(dest, srcStat.atime, srcStat.mtime)
}
}

function onDir (srcStat, src, dest, opts) {
Expand Down

0 comments on commit 5d1f2d3

Please sign in to comment.