diff options
Diffstat (limited to 'node_modules/nyc/bin/nyc.js')
-rwxr-xr-x | node_modules/nyc/bin/nyc.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/node_modules/nyc/bin/nyc.js b/node_modules/nyc/bin/nyc.js index 8918a3503..d7c070a81 100755 --- a/node_modules/nyc/bin/nyc.js +++ b/node_modules/nyc/bin/nyc.js @@ -1,32 +1,32 @@ #!/usr/bin/env node -var configUtil = require('../lib/config-util') -var foreground = require('foreground-child') +const configUtil = require('../lib/config-util') +const foreground = require('foreground-child') var NYC try { NYC = require('../index.covered.js') } catch (e) { NYC = require('../index.js') } -var processArgs = require('../lib/process-args') +const processArgs = require('../lib/process-args') -var sw = require('spawn-wrap') -var wrapper = require.resolve('./wrap.js') +const sw = require('spawn-wrap') +const wrapper = require.resolve('./wrap.js') // parse configuration and command-line arguments; // we keep these values in a few different forms, // used in the various execution contexts of nyc: // reporting, instrumenting subprocesses, etc. -var yargs = configUtil.addCommandsAndHelp(configUtil.buildYargs()) -var instrumenterArgs = processArgs.hideInstrumenteeArgs() -var argv = yargs.parse(instrumenterArgs) +const yargs = configUtil.buildYargs() +const instrumenterArgs = processArgs.hideInstrumenteeArgs() +const config = configUtil.loadConfig(yargs.parse(instrumenterArgs)) +configUtil.addCommandsAndHelp(yargs) +const argv = yargs.config(config).parse(instrumenterArgs) -if (argv._[0] === 'report') { - // look in lib/commands/report.js for logic. -} else if (argv._[0] === 'check-coverage') { - // look in lib/commands/check-coverage.js for logic. -} else if (argv._[0] === 'instrument') { - // look in lib/commands/instrument.js for logic. +if ([ + 'check-coverage', 'report', 'instrument', 'merge' +].indexOf(argv._[0]) !== -1) { + // look in lib/commands for logic. } else if (argv._.length) { // if instrument is set to false, // enable a noop instrumenter. |