<commit_before>var Config = require('./src/utils/Config');
var Logging = require('./src/utils/Logging');

var cfg = new Config().load('config.json');
cfg.log = Logging.console;
Logging.config = cfg;

var starttime = new Date();
var BuildShow = require('./src/package/BuildShow.js');
var showbuilder = new BuildShow(cfg);

var show = process.argv[2] || 'SAShow';
var duration = parseInt(process.argv[3]) || 5400;

showbuilder.on(BuildShow.prototype.COMPLETE, function(stats) {
    cfg.log("SharkAttack", "Show " + show + " created" );
    Logging.recordTaskRun( { start: starttime, end: new Date(), name: 'packaging', details: 'Show ' + show + ' created' } );
});
showbuilder.run(show, duration, cfg.libLocation);<commit_msg>added compression<commit_after>var Config = require('./src/utils/Config');
var Logging = require('./src/utils/Logging');
var zipdir = require('zip-dir');
var path = require('path');

var cfg = new Config().load('config.json');
cfg.log = Logging.console;
Logging.config = cfg;

var starttime = new Date();
var BuildShow = require('./src/package/BuildShow.js');
var showbuilder = new BuildShow(cfg);

var show = process.argv[2] || 'SAShow';
var duration = parseInt(process.argv[3]) || 5400;

showbuilder.on(BuildShow.prototype.COMPLETE, function(stats) {
    cfg.log("SharkAttack", "Show " + show + " created" );
    Logging.recordTaskRun( { start: starttime, end: new Date(), name: 'packaging', details: 'Show ' + show + ' created' } );

    if (cfg.packaging.compress === true) {
        zipdir( cfg.packaging.showLocation + path.sep + show, { saveTo: cfg.packaging.showLocation + path.sep + show + '.zip' }, function (err, buffer) {
            cfg.log("SharkAttack", "Show " + show + " zipped" );
            Logging.recordTaskRun( { start: starttime, end: new Date(), name: 'packaging', details: 'Show ' + show + ' zipped' } );
        });
    }
});
showbuilder.run(show, duration, cfg.libLocation);
{'fraction_non_alphanumeric': 0.1801661474558671, 'fraction_numerical': 0.006230529595015576, 'mean_word_length': 4.323204419889502, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1811944', 'n_tokens_mistral': 618, 'n_tokens_neox': 616, 'n_words': 145}