<commit_before>const {execSync} = require('child_process');
const logger = require('./logger')('exec');

module.exports = (cmd, options) => {
	try {
		return execSync(cmd, options).toString().slice(0, -1);
	} catch (err) {
		logger.error('`%s` failed with code %d', cmd, err.status);
		process.exit(-1);
	}
};<commit_msg>fix exec for empty output<commit_after>const {execSync} = require('child_process');
const logger = require('./logger')('exec');

module.exports = (cmd, options) => {
	try {
		const output = execSync(cmd, options);

		return (output || '').toString().slice(0, -1);
	} catch (err) {
		logger.error('`%s` failed with code %d', cmd, err.status);
		process.exit(-1);
	}
};
{'fraction_non_alphanumeric': 0.21220930232558138, 'fraction_numerical': 0.00872093023255814, 'mean_word_length': 4.741666666666666, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4955460', 'n_tokens_mistral': 243, 'n_tokens_neox': 234, 'n_words': 56}