<commit_before>(function() {
    'use strict';
    
    var path            = require('path'),
        child_process   = require('child_process'),
        
        exec            = child_process.exec,
        
        WIN             = process.platform === 'win32',
        spawn           = child_process.spawn,
        
        Util            = require('util-io'),
        find            = require('glob'),
        win             = require('win32'),
        
        addNewLine      = function (text) {
            var newLine     = '',
                n           = text && text.length;
            
            if (n && text[n-1] !== '\n')
                newLine = '\n';
            
            return text + newLine;
        };
        
    win.prepareCodePage();
    
    module.exports = function(command, options, callback) {
        Util.checkArgs(arguments, ['command', 'callback']);
        
        if (!callback) {
            callback    = options;
            
            options     = {
                cwd: process.cwd()
            };
        }
        
        onMessage(command, options, callback);
    };
    
    function onMessage(command, options, callback) {
        var funcExec, firstChar,
            ret,
            dir         = options.cwd,
            isVolume    = win.isChangeVolume(command),
            isCD        = /^cd ?/.test(command),
            isCDWin     = /^cd ?/i.test(command),
            
            symbolsExec = ['*', '&', '{', '}', '|', '\'', '"', ';'],
            isSymbol    = Util.isContainStr(command, symbolsExec);
        
        Util.checkArgs(arguments, ['connNum', 'callback', 'command']);
        
        if (isCD || isCDWin && WIN || isVolume) {
            ret = true;
            
            onCD(command, dir, function(error, json) {
                var path;
                
                if (!error && json.path) {
                    path        = json.path;
                    options.cwd = path;
                }
                
                callback(error, json);
            });
        }
        
        if (!ret) {
            if (WIN)
                command    = 'cmd /C ' + command;<commit_msg>fix(spawnify) onMessage: no cd if expression fail<commit_after>(function() {
    'use strict';
    
    var path            = require('path'),
        child_process   = require('child_process'),
        
        exec            = child_process.exec,
        
        WIN             = process.platform === 'win32',
        spawn           = child_process.spawn,
        
        Util            = require('util-io'),
        find            = require('glob'),
        win             = require('win32'),
        
        addNewLine      = function (text) {
            var newLine     = '',
                n           = text && text.length;
            
            if (n && text[n-1] !== '\n')
                newLine = '\n';
            
            return text + newLine;
        };
        
    win.prepareCodePage();
    
    module.exports = function(command, options, callback) {
        Util.checkArgs(arguments, ['command', 'callback']);
        
        if (!callback) {
            callback    = options;
            
            options     = {
                cwd: process.cwd()
            };
        }
        
        onMessage(command, options, callback);
    };
    
    function onMessage(command, options, callback) {
        var funcExec, firstChar,
            ret,
            dir         = options.cwd,
            isVolume    = win.isChangeVolume(command),
            isCD        = /^cd ?/.test(command),
            isCDWin     = /^cd ?/i.test(command),
            
            symbolsExec = ['*', '&', '{', '}', '|', '\'', '"', ';'],
            isSymbol    = Util.isContainStr(command, symbolsExec);
        
        Util.checkArgs(arguments, ['connNum', 'callback', 'command']);
        
        if (isCD || isCDWin && WIN || isVolume) {
            ret = true;
            
            onCD(command, dir, function(error, json) {
                var path;
                
                if (json.path) {
                    path        = json.path;
                    options.cwd = path;
                }
                
                callback(error, json);
            });
        }
        
        if (!ret) {
            if (WIN)
                command    = 'cmd /C ' + command;
{'fraction_non_alphanumeric': 0.1263014938886374, 'fraction_numerical': 0.0022634676324128564, 'mean_word_length': 1.0317241379310345, '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': '569813', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1140, 'n_words': 228}