Skip to content

Commit

Permalink
Fix ignoring node_modules in findMatchingFilesWithNode
Browse files Browse the repository at this point in the history
The previous ignore pattern didn't work. Due to how we use a temp folder
as the lookup path in our findMatchingFiles test, it's tricky to add a
test for ignoring the node_modules folder. There's room for improvement:

 - we need a test
 - we should probably ignore nested node_modules folders as well

If I have time, I'll come back to this soon to make it more robust.
  • Loading branch information
trotzig committed May 28, 2016
1 parent f8a6a4a commit bc69bf8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/findMatchingFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ function findMatchingFilesWithNode(
validFilesRegex: string
): Array<string> {
return glob.sync(`${lookupPath}/**/*.js*`, {
ignore: './node_modules/*',
}).filter((filePath: string): bool => new RegExp(validFilesRegex, 'i').test(filePath));
ignore: './node_modules/**/*',
}).filter((filePath: string): bool =>
new RegExp(validFilesRegex, 'i').test(filePath));
}

/**
Expand Down

0 comments on commit bc69bf8

Please sign in to comment.