Choose zip files by exclusion

This commit is contained in:
Rob Garrison 2018-07-20 18:28:14 -05:00
parent 4ee3508506
commit 8b2c6b7ade

View File

@ -6,25 +6,15 @@ const archiver = require('archiver');
function createZip() { function createZip() {
const fileName = 'stylus.zip'; const fileName = 'stylus.zip';
const includes = [ const exclude = [
'_locales/*', '.editorconfig',
'background/*', '.es*',
'content/*', '.git*',
'edit/*', '.github',
'images/*', 'node_modules',
'install-usercss/*', 'tools',
'js/*', 'package.json',
'manage/*', 'stylus.zip'
'msgbox/*',
'options/*',
'popup/*',
'vendor/*',
'vendor-overwrites/*',
'*.html',
'*.css',
'manifest.json',
'LICENSE',
'README.md'
]; ];
const file = fs.createWriteStream(fileName); const file = fs.createWriteStream(fileName);
@ -47,7 +37,7 @@ function createZip() {
}); });
archive.pipe(file); archive.pipe(file);
includes.forEach(file => archive.glob(file)); archive.glob(`!(${exclude.join('|')})`);
archive.finalize(); archive.finalize();
}); });
} }