| |
| var fs = require('fs'); |
| var archiver = require('archiver'); |
|
|
| const VERSION = require('../package.json').version; |
|
|
| |
| var output = fs.createWriteStream(`mulberry-symbols.zip`); |
| var archive = archiver('zip', { |
| zlib: { level: 9 }, |
| }); |
|
|
| |
| |
| output.on('close', function() { |
| console.log(archive.pointer() + ' total bytes added to archive'); |
| }); |
|
|
| |
| |
| |
| output.on('end', function() { |
| console.log('Data has been drained'); |
| }); |
|
|
| |
| archive.on('warning', function(err) { |
| if (err.code === 'ENOENT') { |
| console.log(err); |
| |
| } else { |
| |
| throw err; |
| } |
| }); |
|
|
| |
| archive.on('error', function(err) { |
| throw err; |
| }); |
|
|
| |
| archive.pipe(output); |
|
|
| |
| archive.append(`Mulberry Symbols version: ${VERSION}`, { name: 'VERSION.txt' }); |
|
|
| |
| archive.file('LICENSE.txt', { name: 'LICENSE.txt' }); |
| archive.file('scripts/data/symbol-info.csv', { name: 'symbol-info.csv' }); |
| archive.file('categories/categories-en.pdf', {name: 'categories-en.pdf'}), |
| archive.file('categories/categories-fr.pdf', {name: 'categories-fr.pdf'}); |
|
|
| |
| archive.directory('EN/', 'EN-symbols'); |
|
|
| |
| |
| archive.finalize(); |
|
|