<commit_before>var spawn = require('child_process').spawn;
var p = require('node-promise');
var when = p.when;
var Promise = p.Promise;

var CommandLine = {

    _splitCmd: function(cmd) {
        var cmdParts = cmd.split(' ');

        var command = cmdParts.shift();

        for(var i = 0; i < cmdParts.length; i++) {
            cmdParts[i] = cmdParts[i].replace(/%%/g, ' ');
        }

        return {cmd: command, args: cmdParts};
    },

    _run: function(promise, cmd, args, workingDir) {
        var spawnOperation = spawn(cmd, args, workingDir);

        var output;
        spawnOperation.on('exit', function() {
            promise.resolve(output);
        });
        spawnOperation.stdout.on('data', function (data) {
            output = data.toString('utf-8');
            console.log(output);
        });

        spawnOperation.stderr.on('data', function (data) {<commit_msg>"Update"<commit_after>var spawn = require('child_process').spawn;
var p = require('node-promise');
var when = p.when;
var Promise = p.Promise;

var CommandLine = {

    _splitCmd: function(cmd) {
        var cmdParts = cmd.split(' ');

        var command = cmdParts.shift();

        for(var i = 0; i < cmdParts.length; i++) {
            cmdParts[i] = cmdParts[i].replace(/%%/g, ' ');
        }

        return {cmd: command, args: cmdParts};
    },

    _run: function(promise, cmd, args, workingDir) {
        var spawnOperation = spawn(cmd, args, workingDir);

        var output = "";
        spawnOperation.on('exit', function() {
            promise.resolve(output);
        });
        spawnOperation.stdout.on('data', function (data) {
            output += data.toString('utf-8');
            console.log(output);
        });

        spawnOperation.stderr.on('data', function (data) {
{'fraction_non_alphanumeric': 0.1574539363484087, 'fraction_numerical': 0.002233389168062535, 'mean_word_length': 2.3370577281191807, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6502148', 'n_tokens_mistral': 545, 'n_tokens_neox': 536, 'n_words': 118}