summaryrefslogtreecommitdiff
path: root/deps/npm/lib/utils/completion/file-completion.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/utils/completion/file-completion.js')
-rw-r--r--deps/npm/lib/utils/completion/file-completion.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/deps/npm/lib/utils/completion/file-completion.js b/deps/npm/lib/utils/completion/file-completion.js
index e16b636a68..e4daa4dd4c 100644
--- a/deps/npm/lib/utils/completion/file-completion.js
+++ b/deps/npm/lib/utils/completion/file-completion.js
@@ -1,16 +1,14 @@
module.exports = fileCompletion
-var mkdir = require('mkdirp')
-var glob = require('glob')
+const mkdir = require('mkdirp')
+const glob = require('glob')
function fileCompletion (root, req, depth, cb) {
if (typeof cb !== 'function') {
cb = depth
depth = Infinity
}
- mkdir(root, function (er) {
- if (er) return cb(er)
-
+ mkdir(root).catch(cb).then(() => {
// can be either exactly the req, or a descendent
var pattern = root + '/{' + req + ',' + req + '/**/*}'
var opts = { mark: true, dot: true, maxDepth: depth }