From 58380677c2790a038a7de983c785733f1ce1618c Mon Sep 17 00:00:00 2001 From: refaelos Date: Mon, 20 May 2013 19:17:12 +0300 Subject: [PATCH] assigning original file's mode to the copied file --- lib/wrench.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/wrench.js b/lib/wrench.js index 6cfa8c6..75125b7 100644 --- a/lib/wrench.js +++ b/lib/wrench.js @@ -202,6 +202,8 @@ exports.copyDirSyncRecursive = function(sourceDir, newDirLocation, opts) { var contents = fs.readFileSync(srcFile); fs.writeFileSync(destFile, contents); + var stat = fs.lstatSync(srcFile); + fs.chmodSync(destFile, stat.mode); }; if(currFile.isDirectory()) {