Comparing version 0.6.1 to 0.6.2
@@ -0,1 +1,4 @@ | ||
# Chokidar 0.6.2 (19 March 2013) | ||
* Fixed watching initially empty directories with `ignoreInitial` option. | ||
# Chokidar 0.6.1 (19 March 2013) | ||
@@ -2,0 +5,0 @@ * Added node.js 0.10 support. |
@@ -172,6 +172,6 @@ // Generated by CoffeeScript 1.4.0 | ||
FSWatcher.prototype._handleDir = function(directory) { | ||
FSWatcher.prototype._handleDir = function(directory, initialAdd) { | ||
var read, | ||
_this = this; | ||
read = function(directory) { | ||
read = function(directory, initialAdd) { | ||
return fs.readdir(directory, function(error, current) { | ||
@@ -194,8 +194,10 @@ var previous; | ||
}).forEach(function(file) { | ||
return _this._handle(sysPath.join(directory, file), previous.length === 0); | ||
return _this._handle(sysPath.join(directory, file), initialAdd); | ||
}); | ||
}); | ||
}; | ||
read(directory); | ||
return this._watch(directory, 'directory', read); | ||
read(directory, initialAdd); | ||
return this._watch(directory, 'directory', function(dir) { | ||
return read(dir, false); | ||
}); | ||
}; | ||
@@ -205,5 +207,2 @@ | ||
var _this = this; | ||
if (initialAdd == null) { | ||
initialAdd = false; | ||
} | ||
if (this._ignored(item)) { | ||
@@ -230,3 +229,3 @@ return; | ||
if (stats.isDirectory()) { | ||
return _this._handleDir(item); | ||
return _this._handleDir(item, initialAdd); | ||
} | ||
@@ -247,6 +246,9 @@ }); | ||
FSWatcher.prototype.add = function(files) { | ||
var _this = this; | ||
if (!Array.isArray(files)) { | ||
files = [files]; | ||
} | ||
files.forEach(this._handle); | ||
files.forEach(function(file) { | ||
return _this._handle(file, true); | ||
}); | ||
return this; | ||
@@ -253,0 +255,0 @@ }; |
{ | ||
"name": "chokidar", | ||
"description": "A neat wrapper around node.js fs.watch / fs.watchFile.", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "fs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
31528
268