From 543112bc008c591c4bfbb07ca2fb6521cc97ec7d Mon Sep 17 00:00:00 2001 From: Nick Santos Date: Tue, 20 Dec 2016 15:13:00 -0500 Subject: [PATCH] Use writeStream 'finish' event instead of 'close'. Fixes https://github.com/jprichardson/node-fs-extra/issues/326 --- lib/copy/ncp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/copy/ncp.js b/lib/copy/ncp.js index a9510047..b6192721 100644 --- a/lib/copy/ncp.js +++ b/lib/copy/ncp.js @@ -107,7 +107,7 @@ function ncp (source, dest, options, callback) { }) } - writeStream.once('finish', function () { + writeStream.once('close', function () { fs.chmod(target, file.mode, function (err) { if (err) return onError(err) if (preserveTimestamps) {