<commit_before>'use strict';
var exec = require('child_process').exec;
var Promise = require('lie');

// I tried child-process-promise but it failed without errors and I just don't
// have time to fight with it right now.
module.exports.childProcessExecPromise = function(command, currentWorkingDirectory) {
  return new Promise(function (resolve, reject) {
    exec(command, { cwd: currentWorkingDirectory },
      function (error, stdout, stderr) {
        if (error) {
          reject(error);
          return;
        }
        // Log output even if command doesn't exit with an error,
        // because otherwise useful debugging information might get lost.
        if (stdout) { console.log(stdout); }
        if (stderr) { console.log(stderr); }
        resolve();
      });
  });
};<commit_msg>extend childProcessExecPromise error<commit_after>'use strict';
var exec = require('child_process').exec;
var Promise = require('lie');

// I tried child-process-promise but it failed without errors and I just don't
// have time to fight with it right now.
module.exports.childProcessExecPromise = function(command, currentWorkingDirectory) {
  return new Promise(function (resolve, reject) {
    exec(command, { cwd: currentWorkingDirectory },
      function (error, stdout, stderr) {
        if (error) {
          error.stdout = stdout;
          error.stderr = stderr;

          reject(error);
          return;
        }
        // Log output even if command doesn't exit with an error,
        // because otherwise useful debugging information might get lost.
        if (stdout) { console.log(stdout); }
        if (stderr) { console.log(stderr); }
        resolve();
      });
  });
};
{'fraction_non_alphanumeric': 0.11189634864546526, 'fraction_numerical': 0.0, 'mean_word_length': 2.8265765765765765, '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': '4296493', 'n_tokens_mistral': 453, 'n_tokens_neox': 441, 'n_words': 150}