Skip to content

Commit

Permalink
fix(package): Update fs-extra and use it always instead of fs
Browse files Browse the repository at this point in the history
  • Loading branch information
nprail committed Aug 27, 2019
1 parent 1f678e9 commit 35bb599
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
12 changes: 4 additions & 8 deletions lib/reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ const terminalLink = require('terminal-link')
const Handlebars = require('handlebars')
const moment = require('moment')
const marked = require('marked')
const fse = require('fs-extra')
const fs = require('fs-extra')
const chalk = require('chalk')
const fs = require('fs')
const { promisify } = require('util')

const bootstrapClassSeverityMap = {
low: 'primary',
Expand All @@ -16,8 +14,7 @@ const bootstrapClassSeverityMap = {

const generateTemplate = async (data, template) => {
try {
const readFile = promisify(fs.readFile)
const htmlTemplate = await readFile(template, 'utf8')
const htmlTemplate = await fs.readFile(template, 'utf8')
return Handlebars.compile(htmlTemplate)(data)
} catch (err) {
throw err
Expand All @@ -26,9 +23,8 @@ const generateTemplate = async (data, template) => {

const writeReport = async (report, output) => {
try {
const writeFile = promisify(fs.writeFile)
await fse.ensureFile(output)
await writeFile(output, report)
await fs.ensureFile(output)
await fs.writeFile(output, report)
} catch (err) {
throw err
}
Expand Down
15 changes: 11 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"chalk": "^2.4.2",
"commander": "^2.20.0",
"fs-extra": "^7.0.1",
"fs-extra": "^8.1.0",
"handlebars": "^4.1.2",
"marked": "^0.7.0",
"moment": "^2.24.0",
Expand Down

0 comments on commit 35bb599

Please sign in to comment.