<commit_before>var asyncChainable = require('async-chainable');
var spawnArgs = require('spawn-args');
var spawn = require('child_process').spawn;

module.exports = function() {
	this._plugins['exec'] = function(params) {
		var self = this;
		var stdboth = [];

		var spawner = spawn(params.cmd, params.params, params);

		var dataListener = function(data) {
			var out = data.toString();
			stdboth.push(out.substr(0, out.length -1));
		};
		spawner.stdout.on('data', dataListener);
		spawner.stderr.on('data', dataListener);

		spawner.on('close', function(code) {
			self._context.exec = { // Save details about the last exec in case any future chain wants them
				code: code,
				output: stdboth,
			};<commit_msg>BUGFIX: Setting stdio to "inherit" no longer throws errors<commit_after>var asyncChainable = require('async-chainable');
var spawnArgs = require('spawn-args');
var spawn = require('child_process').spawn;

module.exports = function() {
	this._plugins['exec'] = function(params) {
		var self = this;
		var stdboth = [];

		var spawner = spawn(params.cmd, params.params, params);

		var dataListener = function(data) {
			var out = data.toString();
			stdboth.push(out.substr(0, out.length -1));
		};
		if (spawner.stdout) spawner.stdout.on('data', dataListener);
		if (spawner.stderr) spawner.stderr.on('data', dataListener);

		spawner.on('close', function(code) {
			self._context.exec = { // Save details about the last exec in case any future chain wants them
				code: code,
				output: stdboth,
			};
{'fraction_non_alphanumeric': 0.1490479317137229, 'fraction_numerical': 0.0026263952724885093, 'mean_word_length': 4.273356401384083, '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': '1703864', 'n_tokens_mistral': 536, 'n_tokens_neox': 486, 'n_words': 124}