<commit_before>var cp = require('child_process');

var cmd = process.argv[2];
var argv = process.argv.splice(3);

var proc = cp.spawn(cmd, argv, { detached: false, stdio: ['pipe', 'inherit', 'inherit'], env: process.env, cwd: undefined });

proc.on('exit', function(code) {
  process.exit(code);
});

proc.on('error', function(e) {
  console.error(e.message);
  process.exit(-1);
});

process.stdin.on('data', function(chunk) {
  if (chunk.toString().match('__die__')) {
    process.exit(-1);
  }

  proc.stdin.write(chunk);
});
<commit_msg>Don't truncate build output<commit_after>var cp = require('child_process');

var cmd = process.argv[2];
var argv = process.argv.splice(3);

var proc = cp.spawn(cmd, argv, { detached: false, stdio: ['pipe', 'inherit', 'inherit'], env: process.env, cwd: undefined });

proc.on('exit', function(code) {
  // NB: stdout will actually keep writing after exit fires,
  // so we need to stall for a bit or else we'll lose info
  setTimeout(() => process.exit(code), 5*1000);
});

proc.on('error', function(e) {
  console.error(e.message);
  process.exit(-1);
});

process.stdin.on('data', function(chunk) {
  if (chunk.toString().match('__die__')) {
    process.exit(-1);
  }

  proc.stdin.write(chunk);
});

{'fraction_non_alphanumeric': 0.20128824476650564, 'fraction_numerical': 0.010466988727858293, 'mean_word_length': 4.573991031390134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3261729', 'n_tokens_mistral': 447, 'n_tokens_neox': 435, 'n_words': 99}