Skip to content

Commit

Permalink
fix(reporter): Create missing directories in output path
Browse files Browse the repository at this point in the history
  • Loading branch information
nprail committed Dec 14, 2018
1 parent 252c64d commit 4927958
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
2 changes: 2 additions & 0 deletions lib/reporter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const Handlebars = require('handlebars')
const moment = require('moment')
const marked = require('marked')
const fse = require('fs-extra')
const fs = require('fs')
const { promisify } = require('util')

Expand All @@ -24,6 +25,7 @@ const generateTemplate = async (data, template) => {
const writeReport = async (report, output) => {
try {
const writeFile = promisify(fs.writeFile)
await fse.ensureFile(output)
await writeFile(output, report)
} catch (err) {
throw err
Expand Down
44 changes: 30 additions & 14 deletions 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 @@
},
"dependencies": {
"commander": "^2.15.1",
"fs-extra": "^7.0.1",
"handlebars": "^4.0.11",
"marked": "^0.4.0",
"moment": "^2.22.2"
Expand Down

0 comments on commit 4927958

Please sign in to comment.