<commit_before>var fs       = require('fs'),
    exec = require('child_process').exec,
    async   = require('async'),
    config   = require('../config'),
    commands = {
      'bower.json': 'bower install',
      'component.json': 'component install',
      'package.json': 'npm install'
    };

module.exports = function () {
  var paths = config.paths;

  if (!fs.existsSync(paths.chest)) {
    console.error('Chest not found');
    return;
  }
  var files = fs.readdirSync(paths.chest);
  if (files.length === 0) {
    console.log('Chest is blank');
  }
  async.forEach(files, function (file, done) {
    if (commands[file] === void 0) {
      done();
      return;
    }
    exec(commands[file], function(err, stdout, stderr) {
      if (!err) {
        console.log('stdout: ' + stdout);
        console.log('stderr: ' + stderr)
      } else {
        console.log(err);
        console.log(err.code);
        console.log(err.signal);
      }<commit_msg>Minor tweaks to display stdout/stderr/err<commit_after>var fs       = require('fs'),
    exec = require('child_process').exec,
    async   = require('async'),
    config   = require('../config'),
    commands = {
      'bower.json': 'bower install',
      'component.json': 'component install',
      'package.json': 'npm install'
    };

module.exports = function () {
  var paths = config.paths;

  if (!fs.existsSync(paths.chest)) {
    console.error('Chest not found');
    return;
  }
  var files = fs.readdirSync(paths.chest);
  if (files.length === 0) {
    console.log('Chest is blank');
  }
  async.forEach(files, function (file, done) {
    if (commands[file] === void 0) {
      done();
      return;
    }
    exec(commands[file], function(err, stdout, stderr) {
      if (!err) {
        if (stdout) console.log('stdout:\n' + stdout);
        if (stderr) console.log('stderr:\n' + stderr)
      } else {
        if (err) console.log('err:\n' + err);
      }
{'fraction_non_alphanumeric': 0.17253886010362696, 'fraction_numerical': 0.002072538860103627, 'mean_word_length': 2.562730627306273, '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': '4000789', 'n_tokens_mistral': 637, 'n_tokens_neox': 627, 'n_words': 135}