Skip to content

Commit ccf42df

Browse files
AndrewFinlaycoreyfarrell
authored andcommitted
feat: Rename --temp-directory option to --temp-dir (#897)
* Rename --temp-directory option to --temp-dir * Add -t alias Deprecates the option name --temp-directory in favour of --temp-dir --temp-directory has been demoted to a yargs alias of --temp-dir This change makes the option naming consistent using the form --*-dir
1 parent 4a6b327 commit ccf42df

File tree

6 files changed

+20
-7
lines changed

6 files changed

+20
-7
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ Any configuration options that can be set via the command line can also be speci
291291
],
292292
"cache": true,
293293
"all": true,
294-
"temp-directory": "./alternative-tmp",
294+
"temp-dir": "./alternative-tmp",
295295
"report-dir": "./alternative"
296296
}
297297
}

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function NYC (config) {
4141
this.config = config
4242

4343
this.subprocessBin = config.subprocessBin || path.resolve(__dirname, './bin/nyc.js')
44-
this._tempDirectory = config.tempDirectory || './.nyc_output'
44+
this._tempDirectory = config.tempDir || config.tempDirectory || './.nyc_output'
4545
this._instrumenterLib = require(config.instrumenter || './lib/instrumenters/istanbul')
4646
this._reportDir = config.reportDir || 'coverage'
4747
this._sourceMap = typeof config.sourceMap === 'boolean' ? config.sourceMap : true

lib/commands/merge.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ exports.builder = function (yargs) {
2424
type: 'text',
2525
default: 'coverage.json'
2626
})
27-
.option('temp-directory', {
27+
.option('temp-dir', {
28+
alias: 't',
2829
describe: 'directory to read raw coverage information from',
2930
default: './.nyc_output'
3031
})
32+
.option('temp-directory', {
33+
hidden: true
34+
})
3135
.example('$0 merge ./out coverage.json', 'merge together reports in ./out and output as coverage.json')
3236
}
3337

lib/commands/report.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,14 @@ exports.builder = function (yargs) {
2020
describe: 'directory to output coverage reports in',
2121
default: 'coverage'
2222
})
23-
.option('temp-directory', {
23+
.option('temp-dir', {
24+
alias: 't',
2425
describe: 'directory to read raw coverage information from',
2526
default: './.nyc_output'
2627
})
28+
.option('temp-directory', {
29+
hidden: true
30+
})
2731
.option('show-process-tree', {
2832
describe: 'display the tree of spawned processes',
2933
default: false,

lib/config-util.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,16 @@ Config.buildYargs = function (cwd) {
222222
description: 'specify a different .nycrc path',
223223
global: false
224224
})
225-
.option('temp-directory', {
225+
.option('temp-dir', {
226+
alias: 't',
226227
describe: 'directory to output raw coverage information to',
227228
default: './.nyc_output',
228229
global: false
229230
})
231+
.option('temp-directory', {
232+
hidden: true,
233+
global: false
234+
})
230235
.option('skip-empty', {
231236
describe: 'don\'t show empty files (no lines of code) in report',
232237
default: false,

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"build": "node ./build-tests",
1212
"instrument": "node ./build-self-coverage.js",
1313
"test-integration": "tap -t120 --no-cov -b ./test/build/*.js && mocha --timeout=15000 ./test/nyc-bin.js",
14-
"test-mocha": "node ./bin/nyc --no-clean --silent --temp-directory=./.self_coverage mocha ./test/nyc.js ./test/process-args.js",
15-
"report": "node ./bin/nyc --temp-directory ./.self_coverage/ -r text -r lcov report",
14+
"test-mocha": "node ./bin/nyc --no-clean --silent --temp-dir=./.self_coverage mocha ./test/nyc.js ./test/process-args.js",
15+
"report": "node ./bin/nyc --temp-dir ./.self_coverage/ -r text -r lcov report",
1616
"release": "standard-version"
1717
},
1818
"bin": {

0 commit comments

Comments
 (0)