Comparing version 1.0.3 to 1.0.4
@@ -0,1 +1,4 @@ | ||
# Chokidar 1.0.4 (15 July 2015) | ||
* Fix bug with `ignored` files/globs while `cwd` option is set | ||
# Chokidar 1.0.3 (4 June 2015) | ||
@@ -2,0 +5,0 @@ * Fix race issue with `alwaysStat` option and removed files |
40
index.js
@@ -209,13 +209,21 @@ 'use strict'; | ||
// create the anymatch fn if it doesn't already exist | ||
this._userIgnored = this._userIgnored || anymatch(this._globIgnored | ||
.concat(this.options.ignored) | ||
.concat(arrify(this.options.ignored) | ||
.filter(function(path) { | ||
return typeof path === 'string' && !isglob(path); | ||
}).map(function(path) { | ||
return path + '/**/*'; | ||
}) | ||
) | ||
); | ||
if (!this._userIgnored) { | ||
var cwd = this.options.cwd; | ||
var ignored = this.options.ignored; | ||
if (cwd && ignored) { | ||
ignored = arrify(ignored).map(function (path) { | ||
return isAbsolute(path) ? path : sysPath.join(cwd, path); | ||
}); | ||
} | ||
this._userIgnored = anymatch(this._globIgnored | ||
.concat(ignored) | ||
.concat(arrify(ignored) | ||
.filter(function(path) { | ||
return typeof path === 'string' && !isglob(path); | ||
}).map(function(path) { | ||
return path + '/**/*'; | ||
}) | ||
) | ||
); | ||
} | ||
@@ -384,3 +392,9 @@ return this._userIgnored([path, stats]); | ||
if (cwd) paths = paths.map(function(path) { | ||
return isAbsolute(path) ? path : sysPath.join(cwd, path); | ||
if (isAbsolute(path)) { | ||
return path; | ||
} else if (path[0] === '!') { | ||
return '!' + sysPath.join(cwd, path.substring(1)); | ||
} else { | ||
return sysPath.join(cwd, path); | ||
} | ||
}); | ||
@@ -417,3 +431,3 @@ | ||
}.bind(this), function(error, results) { | ||
results.forEach(function(item){ | ||
results.forEach(function(item) { | ||
if (!item) return; | ||
@@ -420,0 +434,0 @@ this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); |
{ | ||
"name": "chokidar", | ||
"description": "A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "fs", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63827
1158