directory-walker
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -13,2 +13,3 @@ // third-party dependencies | ||
this.onDirectory = config.onDirectory; | ||
this.pending = 0; | ||
@@ -18,3 +19,3 @@ if (config.excludes) { | ||
for (var i = 0; i < config.excludes.length; i++) { | ||
var exclude = path.normalize(config.excludes[i]); | ||
var exclude = path.resolve(config.excludes[i]); | ||
this.excludes[exclude] = true; | ||
@@ -36,8 +37,7 @@ } | ||
DirectoryWalker.prototype.start = function() { | ||
DirectoryWalker.prototype.walk = function(dir) { | ||
// right before we read directory, we increment pending | ||
// right after directory is read, we decrement pending | ||
// when pending drops back to zero then we are down walking | ||
this.pending = 0; | ||
this.readdir(this.basedir); | ||
this.readdir(dir || this.basedir); | ||
}; | ||
@@ -75,3 +75,3 @@ | ||
var dir = path.normalize(dir); | ||
var dir = path.resolve(dir); | ||
if (this.excludes && this.excludes[dir]) { | ||
@@ -97,3 +97,3 @@ return; | ||
for ( var i = 0; i < files.length; i++) { | ||
var file = path.normalize(dir + '/' + files[i]); | ||
var file = path.resolve(dir + '/' + files[i]); | ||
if (!this.excludes || !this.excludes[dir]) { | ||
@@ -100,0 +100,0 @@ self.visit(file, dir); |
{ | ||
"name": "directory-walker", | ||
"description": "Directory walker", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"homepage": "https://github.com/philidem/node-directory-walker", | ||
@@ -6,0 +6,0 @@ "authors": [ |
3367
4