diff options
author | Rebecca Turner <me@re-becca.org> | 2016-02-19 02:19:45 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2016-02-19 03:47:10 +0300 |
commit | 41b2772cb83627f3b5b926cf81e150e7148cb124 (patch) | |
tree | 6a3604df4c9170b421ad16275d3517d0a29f1f04 /node_modules/glob | |
parent | d39743bf9a64ef36f07f40e9caad2de8140b9295 (diff) |
glob@7.0.0
Raise error if `options.cwd` is specified, and not a directory
Credit: @isaacs
Diffstat (limited to 'node_modules/glob')
-rw-r--r-- | node_modules/glob/common.js | 4 | ||||
-rw-r--r-- | node_modules/glob/glob.js | 7 | ||||
-rw-r--r-- | node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js | 2 | ||||
-rw-r--r-- | node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json | 46 | ||||
-rw-r--r-- | node_modules/glob/package.json | 39 | ||||
-rw-r--r-- | node_modules/glob/sync.js | 6 |
6 files changed, 60 insertions, 44 deletions
diff --git a/node_modules/glob/common.js b/node_modules/glob/common.js index c9127eb33..b280e76ce 100644 --- a/node_modules/glob/common.js +++ b/node_modules/glob/common.js @@ -93,8 +93,8 @@ function setopts (self, pattern, options) { if (!ownProp(options, "cwd")) self.cwd = cwd else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd } self.root = options.root || path.resolve(self.cwd, "/") 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 diff --git a/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index a23104e95..932718f92 100644 --- a/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -99,7 +99,7 @@ function expand(str, isTop) { var isOptions = /^(.*,)+(.+)?$/.test(m.body); if (!isSequence && !isOptions) { // {a},b} - if (m.post.match(/,.*}/)) { + if (m.post.match(/,.*\}/)) { str = m.pre + '{' + m.body + escClose + m.post; return expand(str); } diff --git a/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index 78214dbee..2917f0eac 100644 --- a/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -6,16 +6,20 @@ ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.2", + "_id": "brace-expansion@1.1.3", "_inCache": true, "_installable": true, "_location": "/glob/minimatch/brace-expansion", - "_nodeVersion": "4.2.1", + "_nodeVersion": "5.5.0", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" + }, "_npmUser": { "email": "julian@juliangruber.com", "name": "juliangruber" }, - "_npmVersion": "2.14.7", + "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { "name": "brace-expansion", @@ -28,8 +32,8 @@ "_requiredBy": [ "/glob/minimatch" ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz", - "_shasum": "f21445d0488b658e2771efd870eff51df29f04ef", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", + "_shasum": "46bff50115d47fc9ab89854abb87d98078a10991", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch", @@ -47,26 +51,26 @@ }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.2.2" + "tape": "4.4.0" }, "directories": {}, "dist": { - "shasum": "f21445d0488b658e2771efd870eff51df29f04ef", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.2.tgz" + "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" }, - "gitHead": "b03773a30fa516b1374945b68e9acb6253d595fa", + "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", "main": "index.js", "maintainers": [ { - "name": "juliangruber", - "email": "julian@juliangruber.com" + "email": "julian@juliangruber.com", + "name": "juliangruber" }, { - "name": "isaacs", - "email": "isaacs@npmjs.com" + "email": "isaacs@npmjs.com", + "name": "isaacs" } ], "name": "brace-expansion", @@ -82,19 +86,19 @@ }, "testling": { "browsers": [ - "android-browser/4.2..latest", - "chrome/25..latest", - "chrome/canary", + "ie/8..latest", "firefox/20..latest", "firefox/nightly", - "ie/8..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", + "chrome/25..latest", + "chrome/canary", "opera/12..latest", "opera/next", - "safari/5.1..latest" + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" ], "files": "test/*.js" }, - "version": "1.1.2" + "version": "1.1.3" } diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json index c7094df7f..fa4a6e13a 100644 --- a/node_modules/glob/package.json +++ b/node_modules/glob/package.json @@ -2,20 +2,24 @@ "_args": [ [ "glob@latest", - "/Users/zkat/Documents/code/npm" + "/Users/rebecca/code/npm" ] ], "_from": "glob@latest", - "_id": "glob@6.0.4", + "_id": "glob@7.0.0", "_inCache": true, "_installable": true, "_location": "/glob", "_nodeVersion": "4.0.0", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/glob-7.0.0.tgz_1455132435010_0.6941273615229875" + }, "_npmUser": { "email": "i@izs.me", "name": "isaacs" }, - "_npmVersion": "2.14.15", + "_npmVersion": "3.7.0", "_phantomChildren": {}, "_requested": { "name": "glob", @@ -26,18 +30,13 @@ "type": "tag" }, "_requiredBy": [ - "/", - "/init-package-json", - "/read-package-json", - "/tap", - "/tap/nyc", - "/tap/tap-mocha-reporter" + "/" ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.0.tgz", + "_shasum": "3b20a357fffcf46bb384aed6f8ae9a647fdb6ac4", "_shrinkwrap": null, "_spec": "glob@latest", - "_where": "/Users/zkat/Documents/code/npm", + "_where": "/Users/rebecca/code/npm", "author": { "email": "i@izs.me", "name": "Isaac Z. Schlueter", @@ -62,25 +61,25 @@ }, "directories": {}, "dist": { - "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", - "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + "shasum": "3b20a357fffcf46bb384aed6f8ae9a647fdb6ac4", + "tarball": "http://registry.npmjs.org/glob/-/glob-7.0.0.tgz" }, "engines": { "node": "*" }, "files": [ - "common.js", "glob.js", - "sync.js" + "sync.js", + "common.js" ], - "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "gitHead": "8e8876f84232783fd2db3182af5fa33cc83f1989", "homepage": "https://github.com/isaacs/node-glob#readme", "license": "ISC", "main": "glob.js", "maintainers": [ { - "name": "isaacs", - "email": "i@izs.me" + "email": "i@izs.me", + "name": "isaacs" } ], "name": "glob", @@ -99,5 +98,5 @@ "test": "tap test/*.js --cov", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" }, - "version": "6.0.4" + "version": "7.0.0" } diff --git a/node_modules/glob/sync.js b/node_modules/glob/sync.js index 09883d2ce..aa28c87a3 100644 --- a/node_modules/glob/sync.js +++ b/node_modules/glob/sync.js @@ -306,6 +306,12 @@ GlobSync.prototype._readdirError = function (f, er) { 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 + throw error + } break case 'ENOENT': // not terribly unusual |