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:
authorForrest L Norvell <forrest@npmjs.com>2015-03-06 05:25:01 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-03-06 05:25:01 +0300
commit8885c4dfb618f2838930b5c5149abea300a762d6 (patch)
tree4b427f2c56e22dc06f90c578884719f89030f56e /node_modules/glob/glob.js
parent2abc3ee08f0cabc4e7bfd7b973c0b59dc44715ff (diff)
rimraf@2.3.1
* Glob arguments for better Windows support. * Handle bad symlinks properly. * Make maxBusyTries and emfileWait configurable * Also upgrade to glob@4.4.1
Diffstat (limited to 'node_modules/glob/glob.js')
-rw-r--r--node_modules/glob/glob.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/node_modules/glob/glob.js b/node_modules/glob/glob.js
index 0075c1fb8..e1a5c9ece 100644
--- a/node_modules/glob/glob.js
+++ b/node_modules/glob/glob.js
@@ -627,12 +627,23 @@ Glob.prototype._stat = function (f, cb) {
}
var self = this
- var statcb = inflight('stat\0' + abs, statcb_)
+ var statcb = inflight('stat\0' + abs, lstatcb_)
if (statcb)
- fs.stat(abs, statcb)
+ fs.lstat(abs, statcb)
- function statcb_ (er, stat) {
- self._stat2(f, abs, er, stat, cb)
+ function lstatcb_ (er, lstat) {
+ if (lstat && lstat.isSymbolicLink()) {
+ // If it's a symlink, then treat it as the target, unless
+ // the target does not exist, then treat it as a file.
+ return fs.stat(abs, function (er, stat) {
+ if (er)
+ self._stat2(f, abs, null, lstat, cb)
+ else
+ self._stat2(f, abs, er, stat, cb)
+ })
+ } else {
+ self._stat2(f, abs, er, lstat, cb)
+ }
}
}