diff --git a/README.md b/README.md index 587a503a6..77bf74178 100644 --- a/README.md +++ b/README.md @@ -291,7 +291,7 @@ Any configuration options that can be set via the command line can also be speci ], "cache": true, "all": true, - "temp-directory": "./alternative-tmp", + "temp-dir": "./alternative-tmp", "report-dir": "./alternative" } } diff --git a/index.js b/index.js index e7fde82bc..52bcc8bba 100755 --- a/index.js +++ b/index.js @@ -41,7 +41,7 @@ function NYC (config) { this.config = config this.subprocessBin = config.subprocessBin || path.resolve(__dirname, './bin/nyc.js') - this._tempDirectory = config.tempDirectory || './.nyc_output' + this._tempDirectory = config.tempDir || config.tempDirectory || './.nyc_output' this._instrumenterLib = require(config.instrumenter || './lib/instrumenters/istanbul') this._reportDir = config.reportDir || 'coverage' this._sourceMap = typeof config.sourceMap === 'boolean' ? config.sourceMap : true diff --git a/lib/commands/merge.js b/lib/commands/merge.js index f660092d1..11cb7bd1a 100644 --- a/lib/commands/merge.js +++ b/lib/commands/merge.js @@ -24,10 +24,14 @@ exports.builder = function (yargs) { type: 'text', default: 'coverage.json' }) - .option('temp-directory', { + .option('temp-dir', { + alias: 't', describe: 'directory to read raw coverage information from', default: './.nyc_output' }) + .option('temp-directory', { + hidden: true + }) .example('$0 merge ./out coverage.json', 'merge together reports in ./out and output as coverage.json') } diff --git a/lib/commands/report.js b/lib/commands/report.js index ff89da3f8..419134a1f 100644 --- a/lib/commands/report.js +++ b/lib/commands/report.js @@ -20,10 +20,14 @@ exports.builder = function (yargs) { describe: 'directory to output coverage reports in', default: 'coverage' }) - .option('temp-directory', { + .option('temp-dir', { + alias: 't', describe: 'directory to read raw coverage information from', default: './.nyc_output' }) + .option('temp-directory', { + hidden: true + }) .option('show-process-tree', { describe: 'display the tree of spawned processes', default: false, diff --git a/lib/config-util.js b/lib/config-util.js index d8b8cf618..19bbeec54 100644 --- a/lib/config-util.js +++ b/lib/config-util.js @@ -222,11 +222,16 @@ Config.buildYargs = function (cwd) { description: 'specify a different .nycrc path', global: false }) - .option('temp-directory', { + .option('temp-dir', { + alias: 't', describe: 'directory to output raw coverage information to', default: './.nyc_output', global: false }) + .option('temp-directory', { + hidden: true, + global: false + }) .option('skip-empty', { describe: 'don\'t show empty files (no lines of code) in report', default: false, diff --git a/package.json b/package.json index 8c83adc55..806f464a0 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "build": "node ./build-tests", "instrument": "node ./build-self-coverage.js", "test-integration": "tap -t120 --no-cov -b ./test/build/*.js && mocha --timeout=15000 ./test/nyc-bin.js", - "test-mocha": "node ./bin/nyc --no-clean --silent --temp-directory=./.self_coverage mocha ./test/nyc.js ./test/process-args.js", - "report": "node ./bin/nyc --temp-directory ./.self_coverage/ -r text -r lcov report", + "test-mocha": "node ./bin/nyc --no-clean --silent --temp-dir=./.self_coverage mocha ./test/nyc.js ./test/process-args.js", + "report": "node ./bin/nyc --temp-dir ./.self_coverage/ -r text -r lcov report", "release": "standard-version" }, "bin": {