function setConfig (argv) {
        var configLookup = {}
    
        // expand defaults/aliases, in-case any happen to reference
        // the config.json file.
        applyDefaultsAndAliases(configLookup, aliases, defaults)
    
        Object.keys(flags.configs).forEach(function (configKey) {
          var configPath = argv[configKey] || configLookup[configKey]
          if (configPath) {
            try {
              var config = require(path.resolve(process.cwd(), configPath))
    
              Object.keys(config).forEach(function (key) {
                // setting arguments via CLI takes precedence over
                // values within the config file.
                if (argv[key] === undefined || (flags.defaulted[key])) {
                  delete argv[key]
                  setArg(key, config[key])
                }
              })
            } catch (ex) {
              if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath))
            }
          }
        })
      }
function setConfig (argv) {
        var configLookup = {}
    
        // expand defaults/aliases, in-case any happen to reference
        // the config.json file.
        applyDefaultsAndAliases(configLookup, aliases, defaults)
    
        Object.keys(flags.configs).forEach(function (configKey) {
          var configPath = argv[configKey] || configLookup[configKey]
          if (configPath) {
            try {
              var config = require(path.resolve(process.cwd(), configPath))
    
              Object.keys(config).forEach(function (key) {
                // setting arguments via CLI takes precedence over
                // values within the config file.
                if (argv[key] === undefined || (flags.defaulted[key])) {
                  delete argv[key]
                  setArg(key, config[key])
                }
              })
            } catch (ex) {
              if (argv[configKey]) error = Error(__('Invalid JSON config file: %s', configPath))
            }
          }
        })
      }
function setConfig ( argv ) { var configLookup = { } // expand defaults/aliases, in-case any happen to reference // the config.json file. applyDefaultsAndAliases ( configLookup , aliases , defaults ) Object . keys ( flags . configs ) . forEach ( function ( configKey ) { var configPath = argv [ configKey ] || configLookup [ configKey ] if ( configPath ) { try { var config = require ( path . resolve ( process . cwd ( ) , configPath ) ) Object . keys ( config ) . forEach ( function ( key ) { // setting arguments via CLI takes precedence over // values within the config file. if ( argv [ key ] === undefined || ( flags . defaulted [ key ] ) ) { delete argv [ key ] setArg ( key , config [ key ] ) } } ) } catch ( ex ) { if ( argv [ configKey ] ) error = Error ( __ ( 'Invalid JSON config file: %s' , configPath ) ) } } } ) }
set args from config.json file, this should be applied last so that defaults can be applied.
set args from config . json file this should be applied last so that defaults can be applied .