Only set fileMode if not win32, #5865
Ylian Saint-Hilaire committed
Mar 3, 2024 at 12:31 UTC
436a3cb9be3729179f0b236f4806a7141ec9e1d0
1 file changed
+6
-2
pluginHandler.js
+6
-2
@@ -409,8 +409,12 @@ module.exports.pluginHandler = function (parent) {
409
zipfile.openReadStream(entry, function (err, readStream) {
410
if (err) throw err;
411
readStream.on('end', function () { zipfile.readEntry(); });
412
- const fileMode = (entry.externalFileAttributes >> 16) & 0x0fff;
413
- readStream.pipe(obj.fs.createWriteStream(filePath, { mode: fileMode } ));
412
+ if (process.platform == 'win32') {
413
+ readStream.pipe(obj.fs.createWriteStream(filePath));
414
+ } else {
415
+ const fileMode = (entry.externalFileAttributes >> 16) & 0x0fff;
416
+ readStream.pipe(obj.fs.createWriteStream(filePath, { mode: fileMode }));
417
+ }
418
});
419
}
420
});