We should compare filepath with excluded path using "starts-with" because the filepath may be a child of the excluded path

This makes the excludes array work when using -r
This commit is contained in:
Christopher D. Parks 2014-04-03 11:43:24 -07:00
parent 003099a0a8
commit c5a24af559

View File

@ -57,7 +57,7 @@ exports.Filter.prototype.isIncluded = function(filepath) {
if (this.exclude) {
this.exclude.forEach(function(exclude) {
if ( exclude === filepath || exclude === path.dirname(filepath) ) {
if ( filepath.indexOf(exclude) === 0 ) {
included = false;
}
});