[Poly > Yauzl] Add -q option to make extraction faster, remove logging as unneeded
This commit is contained in:
parent
9f7920d287
commit
cabc20ca32
1 changed files with 1 additions and 4 deletions
|
@ -6,7 +6,6 @@ const { join, basename } = require('path');
|
||||||
exports.open = async (zipPath, _options, callback) => {
|
exports.open = async (zipPath, _options, callback) => {
|
||||||
const extractPath = join(global.moduleDataPath, basename(zipPath).split('.')[0].split('-')[0]);
|
const extractPath = join(global.moduleDataPath, basename(zipPath).split('.')[0].split('-')[0]);
|
||||||
const listeners = [];
|
const listeners = [];
|
||||||
log('Yauzl', 'Zip path:', zipPath, 'Extract path:', extractPath);
|
|
||||||
|
|
||||||
const errorOut = (err) => {
|
const errorOut = (err) => {
|
||||||
listeners.error(err);
|
listeners.error(err);
|
||||||
|
@ -24,8 +23,7 @@ exports.open = async (zipPath, _options, callback) => {
|
||||||
|
|
||||||
mkdirSync(extractPath, { recursive: true });
|
mkdirSync(extractPath, { recursive: true });
|
||||||
|
|
||||||
const proc = execFile('unzip', ['-o', zipPath.replaceAll('"', ''), '-d', extractPath]);
|
const proc = execFile('unzip', ['-q', '-o', zipPath.replaceAll('"', ''), '-d', extractPath]);
|
||||||
log('Yauzl', 'Spawned');
|
|
||||||
|
|
||||||
proc.stderr.on('data', errorOut);
|
proc.stderr.on('data', errorOut);
|
||||||
|
|
||||||
|
@ -39,7 +37,6 @@ exports.open = async (zipPath, _options, callback) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
proc.on('close', async () => {
|
proc.on('close', async () => {
|
||||||
log('Yauzl', 'Closed');
|
|
||||||
listeners.end();
|
listeners.end();
|
||||||
});
|
});
|
||||||
};
|
};
|
Loading…
Add table
Add a link
Reference in a new issue