Add support for advzip

Allow recompressing archives before upload for
fastest possible download speeds.
master
Aaron Suen 2021-12-22 16:13:27 -05:00
parent 55dde646fb
commit 587aa81e79
1 changed files with 15 additions and 0 deletions

View File

@ -54,6 +54,21 @@ module.exports = async gitexport => {
});
zipstr.end();
zipstr.close();
if(config.advzip) {
let modeopts = [-4];
if(typeof config.advzip === 'number') {
if(config.advzip <= 4)
modeopts = ['-' + Math.floor(config.advzip)];
else
modeopts.push('-i', Math.floor(config.advzip));
}
const adv = spawn('advzip', ['-z', ...modeopts, zipfile], {
stdio: ['ignore', 'inherit', 'inherit']
});
await adv.promise;
}
const params = {
title: config.version,
commit: commit,