lib/reset.js
function step(err, res) {
  if (!err && res && res.error) {
    console.log('ERR', res);
    err = res.error;
  }
  var nextStep = steps.shift();
  if (err && curStep !== 'delIndex') {
    console.log('failing on', curStep, err);
    console.trace();
    callback(err);
    return;
  }
  if (nextStep) {
    curStep = nextStep;
    var data = stepDefs[curStep].data;
    utils.doPostJson(stepDefs[curStep], data, step);
  } else {
    callback(err, res);
  }
}
function step(err, res) {
  if (!err && res && res.error) {
    console.log('ERR', res);
    err = res.error;
  }
  var nextStep = steps.shift();
  if (err && curStep !== 'delIndex') {
    console.log('failing on', curStep, err);
    console.trace();
    callback(err);
    return;
  }
  if (nextStep) {
    curStep = nextStep;
    var data = stepDefs[curStep].data;
    utils.doPostJson(stepDefs[curStep], data, step);
  } else {
    callback(err, res);
  }
}
function step ( err , res ) { if ( ! err && res && res . error ) { console . log ( 'ERR' , res ) ; err = res . error ; } var nextStep = steps . shift ( ) ; if ( err && curStep !== 'delIndex' ) { console . log ( 'failing on' , curStep , err ) ; console . trace ( ) ; callback ( err ) ; return ; } if ( nextStep ) { curStep = nextStep ; var data = stepDefs [ curStep ] . data ; utils . doPostJson ( stepDefs [ curStep ] , data , step ) ; } else { callback ( err , res ) ; } }
check for an error, if no error do the next step, if no next step callback
check for an error if no error do the next step if no next step callback