function executePlop(data) {
		var _d = q.defer();				// defer for overall plop execution
		var _c = q.defer();				// defer to track the chain of action
		var chain = _c.promise;			// chain promise
		var changes = [];				// array of changed made by the actions
		var failedChanges = [];			// array of actions that failed
		var actions = config.actions;	// the list of actions to execute

		// if action is a function, run it to get our array of actions
		if(typeof actions === 'function') {
			actions = actions(data);
		}

		// setup the chain of actions for this generator
		actions.forEach(function (action, idx) {
			chain = chain.then(function () {

				if (typeof action === 'function') {
					return executeCustomAction(action, idx, data, changes, failedChanges);
				} else {
					return executeActionChain(action, idx, data, changes, failedChanges);
				}
			});
		});

		// add the final step to the chain (reporting the status)
		chain = chain.then(function () {
			_d.resolve({
				changes: changes,
				failures: failedChanges
			});
		});

		_c.resolve();

		return _d.promise;
	}
// Run the actions for this generator
Run the actions for this generator
Run the actions for this generator
function executePlop(data) {
		var _d = q.defer();				
		var _c = q.defer();				
		var chain = _c.promise;			
		var changes = [];				
		var failedChanges = [];			
		var actions = config.actions;	
		if(typeof actions === 'function') {
			actions = actions(data);
		}
		actions.forEach(function (action, idx) {
			chain = chain.then(function () {
				if (typeof action === 'function') {
					return executeCustomAction(action, idx, data, changes, failedChanges);
				} else {
					return executeActionChain(action, idx, data, changes, failedChanges);
				}
			});
		});
		chain = chain.then(function () {
			_d.resolve({
				changes: changes,
				failures: failedChanges
			});
		});
		_c.resolve();
		return _d.promise;
	}
function executePlop ( data ) { var _d = q . defer ( ) ; var _c = q . defer ( ) ; var chain = _c . promise ; var changes = [ ] ; var failedChanges = [ ] ; var actions = config . actions ; if ( typeof actions === 'function' ) { actions = actions ( data ) ; } actions . forEach ( function ( action , idx ) { chain = chain . then ( function ( ) { if ( typeof action === 'function' ) { return executeCustomAction ( action , idx , data , changes , failedChanges ) ; } else { return executeActionChain ( action , idx , data , changes , failedChanges ) ; } } ) ; } ) ; chain = chain . then ( function ( ) { _d . resolve ( { changes : changes , failures : failedChanges } ) ; } ) ; _c . resolve ( ) ; return _d . promise ; }
Run the actions for this generator
Run the actions for this generator
// defer for overall plop execution // defer to track the chain of action // chain promise // array of changed made by the actions // array of actions that failed // the list of actions to execute // if action is a function, run it to get our array of actions // setup the chain of actions for this generator // add the final step to the chain (reporting the status)