Skip to content

Commit

Permalink
fix: switch to mkdirp for Node 8
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed May 3, 2019
1 parent 72bf019 commit 206b83f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bin/c8.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env node
'use strict'

const fs = require('fs')
const foreground = require('foreground-child')
const { outputReport } = require('../lib/commands/report')
const mkdirp = require('mkdirp')
const { promisify } = require('util')
const rimraf = require('rimraf')
const {
Expand All @@ -24,7 +24,8 @@ let argv = buildYargs().parse(instrumenterArgs)
if (argv.clean) {
await promisify(rimraf)(argv.tempDirectory)
}
await promisify(fs.mkdir)(argv.tempDirectory, { recursive: true })
// allow c8 to run on Node 8 (coverage just won't work).
await promisify(mkdirp)(argv.tempDirectory)

process.env.NODE_V8_COVERAGE = argv.tempDirectory
foreground(hideInstrumenterArgs(argv), async (done) => {
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"istanbul-lib-coverage": "^2.0.1",
"istanbul-lib-report": "^2.0.1",
"istanbul-reports": "^2.0.0",
"mkdirp": "^0.5.1",
"rimraf": "^2.6.2",
"test-exclude": "^5.0.0",
"v8-to-istanbul": "^3.1.1",
Expand Down

0 comments on commit 206b83f

Please sign in to comment.