Skip to content

Commit

Permalink
Upgrade mkdirp
Browse files Browse the repository at this point in the history
  • Loading branch information
kukawski committed May 24, 2021
1 parent 88b2c0e commit 352a6d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"invig": "0.0.22",
"js-yaml": "3.6.0",
"lodash": "4.17.21",
"mkdirp": "0.5.1",
"mkdirp": "1.0.4",
"mocha": "5.2.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.2",
Expand Down
14 changes: 6 additions & 8 deletions src/_util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,10 @@ class Util {

buf += `{% codeblock lang:javascript %}${params.code}{% endcodeblock %}`

mkdirp(path.dirname(funcPath), function (err) {
if (err) {
throw new Error('Could not mkdir for ' + funcPath + '. ' + err)
}
mkdirp(path.dirname(funcPath)).then(function () {
fs.writeFile(funcPath, buf, 'utf-8', cb)
}, function (err) {
throw new Error('Could not mkdir for ' + funcPath + '. ' + err)
})
}

Expand Down Expand Up @@ -457,12 +456,11 @@ class Util {
const code = codez.join('\n')

// Write to disk
mkdirp(testdir, function (err) {
if (err) {
throw new Error(err)
}
mkdirp(testdir).then(function () {
debug('writing: ' + testpath)
fs.writeFile(testpath, code, 'utf-8', cb)
}, function (err) {
throw new Error(err)
})
}

Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4689,6 +4689,11 @@ mkdirp@0.5.1, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1:
dependencies:
minimist "0.0.8"

mkdirp@1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==

mocha@5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6"
Expand Down

0 comments on commit 352a6d7

Please sign in to comment.