Skip to content

Commit

Permalink
fix: Create directory for merge destination.
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyfarrell committed Jan 26, 2019
1 parent df2730d commit bbfeefe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/commands/merge.js
@@ -1,5 +1,7 @@
'use strict'
const fs = require('fs')
const path = require('path')
const makeDir = require('make-dir')

var NYC
try {
Expand Down Expand Up @@ -49,6 +51,7 @@ exports.handler = function (argv) {
console.error(`failed access input directory ${argv.inputDirectory} with error:\n\n${err.message}`)
process.exit(1)
}
makeDir.sync(path.dirname(argv.outputFile))
const map = nyc.getCoverageMapFromAllCoverageFiles(argv.inputDirectory)
fs.writeFileSync(argv.outputFile, JSON.stringify(map, null, 2), 'utf8')
console.info(`coverage files in ${argv.inputDirectory} merged into ${argv.outputFile}`)
Expand Down

0 comments on commit bbfeefe

Please sign in to comment.