<commit_before>'use strict';

let fs = require('fs');
let path = require('path');
let fse = require('fs-extra');
let shell = require('shelljs');
let colors = require('colors');
let inquirer = require('inquirer');

const port = 8080;
const task = process.argv[2].substring(1);
const buildjs = process.argv[3] == 'js';
const sourcePath = path.join(__dirname, '../src');
const outputPath = path.join(__dirname, '../dist');

let start = () => {
    function reboot ( err ) {
        if (/listen EADDRINUSE/.test(err.toString())) {
            console.log(`\n${ port } is aleary in use. Ctrl+C to leave or input a PID to kill：`.green);
            Promise.resolve(`lsof -i tcp:${ port }`).then(step2).then(step3).then(( pid ) => {
                return `kill ${ pid }`;
            }).then(step2).catch(( err ) => {
                console.log(err.toString().red);
            }).then(start);
        } else {
            console.log(err.toString().red);
        }
    }
    if (task == 'dev') {
        step1().then(() => {
            return `webpack-dev-server --inline --quiet --devtool eval --progress --colors --content-base ./src/ --hot --config ./webpack/webpack.dev.js --host 0.0.0.0 --port ${ port }`;
        }).then(step2).catch(reboot);
    }
    if (task == 'build') {
        if (buildjs) {
            step1().then(step4).then(step5).then(( option ) => {
                return `webpack --progress --colors --config ./webpack/webpack.build.js${ option }`;
            }).then(step2).then(( cmd ) => {
                return `${ cmd } --uglify`;
            }).then(step2).then(() => {
                console.log('build complete!'.green);
            }).catch((err) => {
                console.log(err.toString().red);
            });
        } else {
            step1().then(() => {
                return `webpack --progress --colors --config ./webpack/webpack.build.js`;
            }).then(step2).then(() => {
                console.log('build complete!'.green);
            }).catch(( err ) => {
                console.log(err.toString().red);
            });
        }
    }<commit_msg>update webpack<commit_after>'use strict';

let fs = require('fs');
let path = require('path');
let fse = require('fs-extra');
let shell = require('shelljs');
let colors = require('colors');
let inquirer = require('inquirer');

const port = 8080;
const task = process.argv[2].substring(1);
const buildjs = process.argv[3] == 'js';
const sourcePath = path.join(__dirname, '../src');
const outputPath = path.join(__dirname, '../dist');

let start = () => {
    function reboot ( err ) {
        if (/listen EADDRINUSE/.test(err.toString())) {
            console.log(`\n${ port } is aleary in use. Ctrl+C to leave or input a PID to kill：`.green);
            Promise.resolve(`lsof -i tcp:${ port }`).then(step2).then(step3).then(( pid ) => {
                return `kill ${ pid }`;
            }).then(step2).catch(( err ) => {
                console.log(err.toString().red);
            }).then(start);
        } else {
            console.log(err.toString().red);
        }
    }
    if (task == 'dev') {
        step1().then(() => {
            return `webpack-dev-server --inline --quiet --devtool eval --progress --colors --content-base ./src/ --hot --config ./webpack/webpack.dev.js --host 0.0.0.0 --port ${ port }`;
        }).then(step2).catch(reboot);
    }
    if (task == 'build') {
        if (buildjs) {
            step1().then(step4).then(step5).then(( option ) => {
                return `webpack --progress --colors --config ./webpack/webpack.build.js${ option }`;
            }).then(step2).then(() => {
                console.log('build complete!'.green);
            }).catch((err) => {
                console.log(err.toString().red);
            });
        } else {
            step1().then(() => {
                return `webpack --progress --colors --config ./webpack/webpack.build.js`;
            }).then(step2).then(() => {
                console.log('build complete!'.green);
            }).catch(( err ) => {
                console.log(err.toString().red);
            });
        }
    }
{'fraction_non_alphanumeric': 0.19864341085271317, 'fraction_numerical': 0.010901162790697675, 'mean_word_length': 1.8833798882681565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '3947467', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1206, 'n_words': 268}