tasks/lib/exec.js
function(grunt, script, sources, params) {

        var flag;
        var cmd = script;
        var args =[];


        // Compute JSDoc options
        for (flag in params) {
            if (params.hasOwnProperty(flag)) {
                if (params[flag] !== false) {
                    args.push('--' + flag);
                }
                if (typeof params[flag] === 'string') {
                    args.push(params[flag]);
                }
            }
        }

        if (!Array.isArray(sources)) {
            sources = [sources];
        }
        args = args.concat(sources);

        grunt.log.debug('Running : ' + cmd + ' ' + args.join(' '));

        return spawn(cmd, args);
    }
function(grunt, script, sources, params) {

        var flag;
        var cmd = script;
        var args =[];


        // Compute JSDoc options
        for (flag in params) {
            if (params.hasOwnProperty(flag)) {
                if (params[flag] !== false) {
                    args.push('--' + flag);
                }
                if (typeof params[flag] === 'string') {
                    args.push(params[flag]);
                }
            }
        }

        if (!Array.isArray(sources)) {
            sources = [sources];
        }
        args = args.concat(sources);

        grunt.log.debug('Running : ' + cmd + ' ' + args.join(' '));

        return spawn(cmd, args);
    }
function ( grunt , script , sources , params ) { var flag ; var cmd = script ; var args = [ ] ; // Compute JSDoc options for ( flag in params ) { if ( params . hasOwnProperty ( flag ) ) { if ( params [ flag ] !== false ) { args . push ( '--' + flag ) ; } if ( typeof params [ flag ] === 'string' ) { args . push ( params [ flag ] ) ; } } } if ( ! Array . isArray ( sources ) ) { sources = [ sources ] ; } args = args . concat ( sources ) ; grunt . log . debug ( 'Running : ' + cmd + ' ' + args . join ( ' ' ) ) ; return spawn ( cmd , args ) ; }
Build and execute a child process using the spawn function
@param {Object} grunt - the grunt context
@param {String} script - the script to run
@param {Array} sources - the list of sources files
@param {Object} params - the list of cli flags
@return {ChildProcess} from the spawn
Build and execute a child process using the spawn function