old_contents: 'use strict';
  
  var argv = require('minimist')(process.argv.slice(2));
  var merge = require('lodash.merge');
  var path = require('path');
  var env = argv.env || process.env.NODE_ENV;
  
  // figure out where the config files are at
  var cfgDir = process.env.NODE_CONFIG_DIR;
  if (!cfgDir) {
    cfgDir = path.resolve(process.cwd, 'config/') + '/';
  } else {
    cfgDir = path.resolve(cfgDir) + '/';
  }
  
  var defaultConfigPath = path.join(cfgDir, 'default');
  var envConfigPath = path.join(cfgDir, env);
  
  var defaultConfig, envConfig;
  
  try {
    defaultConfig = require(defaultConfigPath);
  } catch (err) {
    defaultConfig = {}; // no default specified
  }
  
  try {
    envConfig = require(envConfigPath);
  } catch (err) {
    envConfig = {}; // no env specified
  }
  
  module.exports = merge(defaultConfig, envConfig);
  
new_contents: 'use strict';
  
  var argv = require('minimist')(process.argv.slice(2));
  var merge = require('lodash.merge');
  var path = require('path');
  var env = argv.env || process.env.NODE_ENV;
  
  var envConfigPath, defaultConfigPath, cfgDir,
    defaultConfig, envConfig;
  
  // figure out where the config files are at
  cfgDir = process.env.NODE_CONFIG_DIR;
  if (!cfgDir) {
    cfgDir = path.resolve(process.cwd, 'config/') + '/';
  } else {
    cfgDir = path.resolve(cfgDir) + '/';
  }
  
  
  var defaultConfigPath = path.join(cfgDir, 'default');
  
  if (env) {
    envConfigPath = path.join(cfgDir, env);
  }
  
  try {
    defaultConfig = require(defaultConfigPath);
  } catch (err) {
    defaultConfig = {}; // no default specified
  }
  
  try {
    if (envConfigPath) {
      envConfig = require(envConfigPath);
    } else {
      envConfig = {};
    }
  } catch (err) {
    envConfig = {}; // no env specified
  }
  
  module.exports = merge(defaultConfig, envConfig);
  
subject: fix null env bug