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