Skip to content

Commit

Permalink
Use a simple (file[0] == '.') test instead of a full regexp to ignore…
Browse files Browse the repository at this point in the history
… hidden files
  • Loading branch information
elisee authored and Justin Slattery committed Jul 12, 2011
1 parent 7c9ee8e commit 420f159
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/stalker.js
Expand Up @@ -20,7 +20,7 @@
if (err) { return fnAdd && fnAdd(err); }

files.forEach(function _forEach(file){
if (/^\./.test(file)) { return; } //ignore files starting with "."
if (file[0] == '.') { return; } //ignore files starting with "."

var fPath = path.join(folderPath, file);
fs.stat(fPath, function _stat(err, stats) {
Expand Down Expand Up @@ -75,7 +75,7 @@
if (err) { return fnAdd && fnAdd(err); }

files.forEach(function (file) {
if (/^\./.test(file)) { return; } //ignore files starting with "."
if (file[0] == '.') { return; } //ignore files starting with "."

var rPath = path.join(fPath, file);
watchFolderTree(rPath, fnAdd, fnRemove);
Expand Down

0 comments on commit 420f159

Please sign in to comment.