forked from olcxjas-softworks/LarpixClient
fix gitignore again
This commit is contained in:
parent
ce5a1e330b
commit
5da5c2afe2
3329 changed files with 364540 additions and 3 deletions
22
electron/node_modules/native-run/dist/utils/unzip.js
generated
vendored
Normal file
22
electron/node_modules/native-run/dist/utils/unzip.js
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.unzip = void 0;
|
||||
const util_1 = require("util");
|
||||
async function unzip(srcPath, onEntry) {
|
||||
const yauzl = await Promise.resolve().then(() => require('yauzl'));
|
||||
return new Promise((resolve, reject) => {
|
||||
yauzl.open(srcPath, { lazyEntries: true }, (err, zipfile) => {
|
||||
if (!zipfile || err) {
|
||||
return reject(err);
|
||||
}
|
||||
const openReadStream = (0, util_1.promisify)(zipfile.openReadStream.bind(zipfile));
|
||||
zipfile.once('error', reject);
|
||||
// resolve when either one happens
|
||||
zipfile.once('close', resolve); // fd of zip closed
|
||||
zipfile.once('end', resolve); // last entry read
|
||||
zipfile.on('entry', (entry) => onEntry(entry, zipfile, openReadStream));
|
||||
zipfile.readEntry();
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.unzip = unzip;
|
||||
Loading…
Add table
Add a link
Reference in a new issue