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-13 10:53:55 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-03-13 10:53:55 +0300
commit0c85db7f0dde41762411e40a029153e6a65ef483 (patch)
tree0e39d0dd1b37fa2df359d05913559be2ae14bb2d /node_modules/rimraf/rimraf.js
parent051c4738486a826300f205b71590781ce7744f01 (diff)
rimraf@2.3.2
Handle globbing paths with valid glob metacharacters in the path.
Diffstat (limited to 'node_modules/rimraf/rimraf.js')
-rw-r--r--node_modules/rimraf/rimraf.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js
index 6dffdf064..c189d5444 100644
--- a/node_modules/rimraf/rimraf.js
+++ b/node_modules/rimraf/rimraf.js
@@ -54,7 +54,15 @@ function rimraf (p, options, cb) {
var errState = null
var n = 0
- glob(p, globOpts, afterGlob)
+ if (!glob.hasMagic(p))
+ return afterGlob(null, [p])
+
+ fs.lstat(p, function (er, stat) {
+ if (!er)
+ return afterGlob(null, [p])
+
+ glob(p, globOpts, afterGlob)
+ })
function next (er) {
errState = errState || er
@@ -249,7 +257,19 @@ function rimrafSync (p, options) {
assert(p)
assert(options)
- var results = glob.sync(p, globOpts)
+ var results
+
+ if (!glob.hasMagic(p)) {
+ results = [p]
+ } else {
+ try {
+ fs.lstatSync(p)
+ results = [p]
+ } catch (er) {
+ results = glob.sync(p, globOpts)
+ }
+ }
+
if (!results.length)
return