"use strict";
function postCliExecution(complete) {
    var taskErrors = complete.taskErrors, config = complete.config;
    /**
     * If an error occurred, we need to exit the process
     * with any error codes if given
     */
    if (taskErrors.length > 0 && config.fail) {
        var lastError = taskErrors[taskErrors.length - 1];
        var stats = lastError.stats;
        if (stats.cbExitCode !== undefined) {
            process.exit(stats.cbExitCode);
        }
        process.exit(1);
    }
}
exports.postCliExecution = postCliExecution;
//# sourceMappingURL=command.run.post-execution.js.map