tasks/reconfigure.js
function(obj, env, keypath) {
    if (!_.isObject(obj) || _.isArray(obj)) { return; }

    if (hasKeyPath(obj, ['options', 'reconfigureOverrides', env])) {
      var options = obj.options,
          overrides = obj.options.reconfigureOverrides[env];

      for (var key in overrides) {
        var update = { 
          key: keypath+'.options.'+key,
          oldVal: (typeof options[key] === 'undefined') ? 'undefined' : util.inspect(options[key]),
        };

        if (_.isObject(options[key]) && _.isObject(overrides[key])) { 
          var newVal = _.extend(options[key], overrides[key]);
          update.newVal = util.inspect(newVal);
        } else {
          options[key] = overrides[key];
          update.newVal = util.inspect(overrides[key]);
        }

        updates.push(update);
      }
    }
    
    for (var objKey in obj) {
      updateOptions(obj[objKey], env, keypath+'.'+objKey);
    }
  }
function(obj, env, keypath) {
    if (!_.isObject(obj) || _.isArray(obj)) { return; }

    if (hasKeyPath(obj, ['options', 'reconfigureOverrides', env])) {
      var options = obj.options,
          overrides = obj.options.reconfigureOverrides[env];

      for (var key in overrides) {
        var update = { 
          key: keypath+'.options.'+key,
          oldVal: (typeof options[key] === 'undefined') ? 'undefined' : util.inspect(options[key]),
        };

        if (_.isObject(options[key]) && _.isObject(overrides[key])) { 
          var newVal = _.extend(options[key], overrides[key]);
          update.newVal = util.inspect(newVal);
        } else {
          options[key] = overrides[key];
          update.newVal = util.inspect(overrides[key]);
        }

        updates.push(update);
      }
    }
    
    for (var objKey in obj) {
      updateOptions(obj[objKey], env, keypath+'.'+objKey);
    }
  }
function ( obj , env , keypath ) { if ( ! _ . isObject ( obj ) || _ . isArray ( obj ) ) { return ; } if ( hasKeyPath ( obj , [ 'options' , 'reconfigureOverrides' , env ] ) ) { var options = obj . options , overrides = obj . options . reconfigureOverrides [ env ] ; for ( var key in overrides ) { var update = { key : keypath + '.options.' + key , oldVal : ( typeof options [ key ] === 'undefined' ) ? 'undefined' : util . inspect ( options [ key ] ) , } ; if ( _ . isObject ( options [ key ] ) && _ . isObject ( overrides [ key ] ) ) { var newVal = _ . extend ( options [ key ] , overrides [ key ] ) ; update . newVal = util . inspect ( newVal ) ; } else { options [ key ] = overrides [ key ] ; update . newVal = util . inspect ( overrides [ key ] ) ; } updates . push ( update ) ; } } for ( var objKey in obj ) { updateOptions ( obj [ objKey ] , env , keypath + '.' + objKey ) ; } }
Recursively step through the provided object, searching for an `options` object with `reconfigureOverrides` containing the provided `env`. If it finds one, it resets any keys and values found inside on the containing `options` object.
Recursively step through the provided object searching for an options object with reconfigureOverrides containing the provided env . If it finds one it resets any keys and values found inside on the containing options object .