diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/make-dir/index.js | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/make-dir/index.js')
-rw-r--r-- | node_modules/make-dir/index.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/node_modules/make-dir/index.js b/node_modules/make-dir/index.js index ca1f5e9c6..18439555f 100644 --- a/node_modules/make-dir/index.js +++ b/node_modules/make-dir/index.js @@ -25,10 +25,12 @@ const checkPath = pth => { module.exports = (input, opts) => Promise.resolve().then(() => { checkPath(input); opts = Object.assign({}, defaults, opts); - const fsP = pify(opts.fs); + + const mkdir = pify(opts.fs.mkdir); + const stat = pify(opts.fs.stat); const make = pth => { - return fsP.mkdir(pth, opts.mode) + return mkdir(pth, opts.mode) .then(() => pth) .catch(err => { if (err.code === 'ENOENT') { @@ -39,7 +41,7 @@ module.exports = (input, opts) => Promise.resolve().then(() => { return make(path.dirname(pth)).then(() => make(pth)); } - return fsP.stat(pth) + return stat(pth) .then(stats => stats.isDirectory() ? pth : Promise.reject()) .catch(() => { throw err; @@ -69,7 +71,7 @@ module.exports.sync = (input, opts) => { try { if (!opts.fs.statSync(pth).isDirectory()) { - throw new Error(); + throw new Error('The path is not a directory'); } } catch (_) { throw err; |