Skip to content

Commit

Permalink
use close instead of finish event for file copy completion (yarnpkg#3234
Browse files Browse the repository at this point in the history
)

Windows Defender updates timestamps on files immediately after a write stream closes. Moving utimes update to after the file has closed corrects this issue.
  • Loading branch information
sciolist authored and bestander committed Apr 26, 2017
1 parent 086f9b8 commit 0f2de58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ export async function copyBulk(
readStream.pipe(writeStream);
});

writeStream.once('finish', function() {
writeStream.once('close', function() {
fs.utimes(data.dest, data.atime, data.mtime, function(err) {
if (err) {
reject(err);
Expand Down

0 comments on commit 0f2de58

Please sign in to comment.