Only set fileMode if not win32, #5865

This commit is contained in:
Ylian Saint-Hilaire 2024-03-03 12:31:32 -08:00
parent e6a71d77a1
commit 436a3cb9be

View File

@ -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 }));
}
});
}
});