From 8b2c6b7ade5512449cf3f2d2c442c896502be3d2 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Fri, 20 Jul 2018 18:28:14 -0500 Subject: [PATCH] Choose zip files by exclusion --- tools/zip.js | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/tools/zip.js b/tools/zip.js index 995539e5..c7cf3fda 100644 --- a/tools/zip.js +++ b/tools/zip.js @@ -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(); }); }