<commit_before>
var spawn = require('child_process').spawn;

function git(cmd, args, done) {
  spawn('git', [cmd].concat(args), { stdio:'inherit' })
    .on('error', function(e) { console.log('git', args); throw e; })
    .on('exit', done);
}

function register(cmd) {
  return function(args, done) { git(cmd, args, done); };
}

['init', 'checkout', 'pull', 'push', 'reset', 'remote']
.forEach(function(cmd) {
  exports[cmd] = register(cmd);
});
<commit_msg>Show error message if 'git' is not found.<commit_after>
var spawn = require('child_process').spawn;

function git(cmd, args, done) {
  spawn('git', [cmd].concat(args), { stdio:'inherit' })
    .on('error', function(e) { errorHandler(e, cmd, args); })
    .on('exit', done);
}

function errorHandler(e, cmd, args) {
  if (e.code == 'ENOENT') {
    console.log('Please install git before running this command.');
    process.exit();
  } else {
    console.log('git', cmd, args);
    throw e;
  }
}

function register(cmd) {
  return function(args, done) { git(cmd, args, done); };
}

['init', 'checkout', 'pull', 'push', 'reset', 'remote']
.forEach(function(cmd) {
  exports[cmd] = register(cmd);
});

{'fraction_non_alphanumeric': 0.21348314606741572, 'fraction_numerical': 0.0, 'mean_word_length': 4.54066985645933, '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': '4244521', 'n_tokens_mistral': 403, 'n_tokens_neox': 405, 'n_words': 99}