Skip to content

Commit

Permalink
fix: Create directory for merge destination. (#979)
Browse files Browse the repository at this point in the history
Fixes #976
  • Loading branch information
coreyfarrell authored Jan 27, 2019
1 parent df2730d commit 921d386
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/commands/merge.js
Original file line number Diff line number Diff line change
@@ -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 921d386

Please sign in to comment.