From 436a3cb9be3729179f0b236f4806a7141ec9e1d0 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Sun, 3 Mar 2024 12:31:32 -0800 Subject: [PATCH] Only set fileMode if not win32, #5865 --- pluginHandler.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pluginHandler.js b/pluginHandler.js index ceb911c9..d1d324ee 100644 --- a/pluginHandler.js +++ b/pluginHandler.js @@ -409,8 +409,12 @@ module.exports.pluginHandler = function (parent) { zipfile.openReadStream(entry, function (err, readStream) { if (err) throw err; readStream.on('end', function () { zipfile.readEntry(); }); - const fileMode = (entry.externalFileAttributes >> 16) & 0x0fff; - readStream.pipe(obj.fs.createWriteStream(filePath, { mode: fileMode } )); + if (process.platform == 'win32') { + readStream.pipe(obj.fs.createWriteStream(filePath)); + } else { + const fileMode = (entry.externalFileAttributes >> 16) & 0x0fff; + readStream.pipe(obj.fs.createWriteStream(filePath, { mode: fileMode })); + } }); } });