<commit_before>#!/usr/bin/env node

require('colorful').colorful();

var program = require('commander');
var task = require('../task');
var logger = require('../logger');
var path = require('path');
var spawn = require('cross-spawn');

program
    .usage('[options]')
    .option('-s, --sourcemap', 'generate source map')
    .option('-C, --no-clean', 'disable clean before a new build')
    .on('-h', printHelp)
    .on('--help', printHelp)
    .parse(process.argv);

function printHelp() {
    console.log('  Examples:'.to.bold.blue.color);
    console.log();
    console.log('    kil build -s     enable source ');
    console.log();
}

var args = {
    sourcemap: program.sourcemap,
    clean: program.clean
}

logger.debug("kil build with options: ");
logger.debug(args);

if (clean) {
    var cleanScript = path.join(__dirname, '/kil-clean.js');
    spawn(cleanScript, {
        stdio: 'inherit'
    }).on('close', (code) => {
        task.build(args);
    });
} else {
    task.build(args);
}<commit_msg>add clean option for kil build<commit_after>#!/usr/bin/env node

require('colorful').colorful();

var program = require('commander');
var task = require('../task');
var logger = require('../logger');
var path = require('path');
var spawn = require('cross-spawn');

program
    .usage('[options]')
    .option('-s, --sourcemap', 'generate source map')
    .option('-C, --no-clean', 'disable clean before a new build')
    .on('-h', printHelp)
    .on('--help', printHelp)
    .parse(process.argv);

function printHelp() {
    console.log('  Examples:'.to.bold.blue.color);
    console.log();
    console.log('    kil build -s     enable source ');
    console.log();
}

var args = {
    sourcemap: program.sourcemap,
    clean: program.clean
}

logger.debug("kil build with options: ");
logger.debug(args);

if (program.clean) {
    var cleanScript = path.join(__dirname, '/kil-clean.js');
    spawn(cleanScript, {
        stdio: 'inherit'
    }).on('close', (code) => {
        task.build(args);
    });
} else {
    task.build(args);
}
{'fraction_non_alphanumeric': 0.19589643380556912, 'fraction_numerical': 0.0, 'mean_word_length': 3.1710794297352343, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4285359', 'n_tokens_mistral': 674, 'n_tokens_neox': 670, 'n_words': 155}