Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2016-02-19 02:19:45 +0300
committerRebecca Turner <me@re-becca.org>2016-02-19 03:47:10 +0300
commit41b2772cb83627f3b5b926cf81e150e7148cb124 (patch)
tree6a3604df4c9170b421ad16275d3517d0a29f1f04 /node_modules/glob/glob.js
parentd39743bf9a64ef36f07f40e9caad2de8140b9295 (diff)
glob@7.0.0
Raise error if `options.cwd` is specified, and not a directory Credit: @isaacs
Diffstat (limited to 'node_modules/glob/glob.js')
-rw-r--r--node_modules/glob/glob.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js
index a62da27eb..804cde53f 100644
--- a/node_modules/glob/glob.js
+++ b/node_modules/glob/glob.js
@@ -572,6 +572,13 @@ Glob.prototype._readdirError = function (f, er, cb) {
case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
case 'ENOTDIR': // totally normal. means it *does* exist.
this.cache[this._makeAbs(f)] = 'FILE'
+ if (f === this.cwd) {
+ var error = new Error(er.code + ' invalid cwd ' + f)
+ error.path = f
+ error.code = er.code
+ this.emit('error', error)
+ this.abort()
+ }
break
case 'ENOENT': // not terribly unusual