<commit_before>var isArg, exists = require('fs').existsSync;

// Command is a service for routing commands to specific files.
// This service is assuming that the command file is a function..
module.exports = function Command(cmd) {
    cmd = (__dirname + '/' + cmd + '.js');
    // Checking for whether the files exists at this point should be only for development
    // Otherwise, we know the files exists, so this just become an extra function call
    // Once fully deployed, we shouldn't be checking whether the command file exists.
    isArg = exists(cmd);

    // We probably should not be exiting here.
    // It is best to return here and exit at the root.
    // This will only be a defect on a Linux machine.
    // Let's consider making an exiting service that will exit once the commands are done, or on errors.
    if ( !isArg ) {
        console.log('[%s] Command %s does not exist!', 'Error'.red, cmd.red);
        // return;
        process.ext(1);
    }

    //return a function for program.action() to call, and pass the arguments through.
    return function() {
        return require( cmd ).apply(this, arguments);
    }
};<commit_msg>style(spelling): Fix spelling issues at commands/index<commit_after>var isArg, exists = require('fs').existsSync;

// Command is a service for routing commands to specific files.
// This service is assuming that the command file is a function..
module.exports = function Command(cmd) {
    cmd = (__dirname + '/' + cmd + '.js');
    // Checking for whether the files exists at this point, should only be for development
    // Otherwise, we know the files exists, so this just becomes an extra function call
    // Once fully deployed, we shouldn't be checking whether the command file exists.
    isArg = exists(cmd);

    // We probably should not be exiting here.
    // It is best to return here and exit at the root.
    // This will only be a defect on a Linux machine.
    // Let's consider making an exiting service that will exit once the commands are done, or on errors.
    if ( !isArg ) {
        console.log('[%s] Command %s does not exist!', 'Error'.red, cmd.red);
        // return;
        process.exit(1);
    }

    //return a function for program.action() to call, and pass the arguments through.
    return function() {
        return require( cmd ).apply(this, arguments);
    }
};
{'fraction_non_alphanumeric': 0.09872881355932203, 'fraction_numerical': 0.000847457627118644, 'mean_word_length': 2.8019323671497585, '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': '4762764', 'n_tokens_mistral': 624, 'n_tokens_neox': 608, 'n_words': 305}