From 864a8fd321673b2413f479610fb3a763f0e4e680 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 11 Jan 2016 12:23:32 +0100 Subject: [PATCH] set `mode` for directories too - fixes #62 --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 86f9d35..e515d05 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,8 @@ module.exports = function (filename, opts) { if (file.isNull() && file.stat && file.stat.isDirectory && file.stat.isDirectory()) { zip.addEmptyDirectory(pathname, { - mtime: file.stat.mtime || new Date() + mtime: file.stat.mtime || new Date(), + mode: file.stat.mode }); } else { zip.addBuffer(file.contents, pathname, {