main.js
function (execPlan, first, preLogic, command, options, errorHandler, nextStep) {
    return function (error, stdout, stderr) {
        var shouldContinue; // whether the plan should continue executing beyond this step

        // log stdout/err
        if (!first) {  // a previous step's stdout/err is available
            if (execPlan.willAutoPrintOut())           console.log(stdout);
            if (error && execPlan.willAutoPrintErr())  console.error(stderr);
        }

        // continue execution plan, unless it should be stopped, as determined by, e.g.,
        // the error handler.
        shouldContinue = (!error || handleError(execPlan, error, stderr, errorHandler));
        if (shouldContinue) {
            preLogic(stdout);
            if (options === null) exec(command, nextStep);
            else                  exec(command, options, nextStep);
        } else {
            finish(execPlan);
        }
    };
}
function (execPlan, first, preLogic, command, options, errorHandler, nextStep) {
    return function (error, stdout, stderr) {
        var shouldContinue; // whether the plan should continue executing beyond this step

        // log stdout/err
        if (!first) {  // a previous step's stdout/err is available
            if (execPlan.willAutoPrintOut())           console.log(stdout);
            if (error && execPlan.willAutoPrintErr())  console.error(stderr);
        }

        // continue execution plan, unless it should be stopped, as determined by, e.g.,
        // the error handler.
        shouldContinue = (!error || handleError(execPlan, error, stderr, errorHandler));
        if (shouldContinue) {
            preLogic(stdout);
            if (options === null) exec(command, nextStep);
            else                  exec(command, options, nextStep);
        } else {
            finish(execPlan);
        }
    };
}
function ( execPlan , first , preLogic , command , options , errorHandler , nextStep ) { return function ( error , stdout , stderr ) { var shouldContinue ; // whether the plan should continue executing beyond this step // log stdout/err if ( ! first ) { // a previous step's stdout/err is available if ( execPlan . willAutoPrintOut ( ) ) console . log ( stdout ) ; if ( error && execPlan . willAutoPrintErr ( ) ) console . error ( stderr ) ; } // continue execution plan, unless it should be stopped, as determined by, e.g., // the error handler. shouldContinue = ( ! error || handleError ( execPlan , error , stderr , errorHandler ) ) ; if ( shouldContinue ) { preLogic ( stdout ) ; if ( options === null ) exec ( command , nextStep ) ; else exec ( command , options , nextStep ) ; } else { finish ( execPlan ) ; } } ; }
this is an internal API, so for the time being, assume all arguments are valid.
provides a function that corresponds to a 'step' in an execution plan.
@param execPlan ExecPlan
@param first Boolean         - whether this corresponds to the 'first' step in execution plan.
@param preLogic Function     - function to execute before command is exec'd. See: ExecPlan.add.
@param command String        - the command to exec. See: ExecPlan.add.
@param options Object        - config options for exec. See: ChildProcess.exec.
@param errorHandler Function - error handler from previous step. See: ExecPlan.add.
@param nextStep Function     - the callback for exec for next step. See: ChildProcess.exec.
@return Function             - callback to use as a step. See: ChildProcess.exec.
this is an internal API so for the time being assume all arguments are valid . provides a function that corresponds to a step in an execution plan .