diff options
Diffstat (limited to 'node_modules/make-dir')
-rw-r--r-- | node_modules/make-dir/index.js | 10 | ||||
-rw-r--r-- | node_modules/make-dir/package.json | 8 | ||||
-rw-r--r-- | node_modules/make-dir/readme.md | 3 |
3 files changed, 13 insertions, 8 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; diff --git a/node_modules/make-dir/package.json b/node_modules/make-dir/package.json index 2a501da28..ec907a71f 100644 --- a/node_modules/make-dir/package.json +++ b/node_modules/make-dir/package.json @@ -1,6 +1,6 @@ { "name": "make-dir", - "version": "1.1.0", + "version": "1.3.0", "description": "Make a directory and its parents if needed - Think `mkdir -p`", "license": "MIT", "repository": "sindresorhus/make-dir", @@ -44,11 +44,11 @@ }, "devDependencies": { "ava": "*", - "codecov": "^2.1.0", + "codecov": "^3.0.0", "graceful-fs": "^4.1.11", - "nyc": "^10.2.0", + "nyc": "^11.3.0", "path-type": "^3.0.0", "tempy": "^0.2.1", - "xo": "*" + "xo": "^0.20.0" } } diff --git a/node_modules/make-dir/readme.md b/node_modules/make-dir/readme.md index c8b348305..8a32bf471 100644 --- a/node_modules/make-dir/readme.md +++ b/node_modules/make-dir/readme.md @@ -106,6 +106,9 @@ Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com - [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module - [del](https://github.com/sindresorhus/del) - Delete files and directories - [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching +- [cpy](https://github.com/sindresorhus/cpy) - Copy files +- [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line +- [move-file](https://github.com/sindresorhus/move-file) - Move a file ## License |