#14 negate match
if (grunt.file.match(srcFilters, [f]).length === 0) {
return;
}
In the above code, f is an absolute path which seems to be the reason of the problem. One solution would have been to replace the above if condition with something like:
var relPath = path.relative(path.join(process.cwd(), dest), f);
if (grunt.file.match(srcFilters, [relPath ]).length === 0) {
However after doing the above fix, src patterns such as **.js do not work.
I would think that instead of using readDir.readSync grunt's files.src.filter would do a better job. If you'd like to try this way, I can try to send a PR over the weekend.
grunt sloc
seems to be ignoring many files which are included in the src pattern.To be more specific, here's my sloc config:
and here's my directory structure:
number of files read by
grunt sloc
is zero. It should have been 2 files.The problem does not occur after commenting out these lines related to solving issue #14:
In the above code,
f
is an absolute path which seems to be the reason of the problem. One solution would have been to replace the aboveif
condition with something like:However after doing the above fix, src patterns such as
**.js
do not work.I would think that instead of using
readDir.readSync
grunt'sfiles.src.filter
would do a better job. If you'd like to try this way, I can try to send a PR over the weekend.