Skip to content

Commit

Permalink
fix(findFiles): Fix the discovery of files when a directory of partia…
Browse files Browse the repository at this point in the history
…l name match occurs
  • Loading branch information
EntraptaJ committed May 12, 2020
1 parent d7d4462 commit 2e5d8ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/findFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ async function findFile(
const directoryFileName = directoryEntry.name;

if (directoryEntry.name.includes(fileName)) {
if (directoryEntry.isDirectory()) return true;
if (directoryEntry.name === fileName && directoryEntry.isDirectory()) {
return true;
}

for (let extension of [...extensions, ...JS_EXTS]) {
if (directoryFileName === fileName + extension) {
Expand Down

0 comments on commit 2e5d8ed

Please sign in to comment.