Skip to content

Commit 8713561

Browse files
committed
docs(changeset): fix file walker. Do not walk .git and cleanly process only relative path to ensure proper pattern match.
1 parent 01d6afc commit 8713561

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/moody-otters-march.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"git-json-resolver": patch
3+
---
4+
5+
fix file walker. Do not walk .git and cleanly process only relative path to ensure proper pattern match.

lib/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ export const listMatchingFiles = async (options: CollectFilesOptions): Promise<F
5858

5959
if (entry.isDirectory()) {
6060
/* v8 ignore next */
61-
if (!/node_modules/.test(entry.name)) {
61+
if (!/node_modules|\.git/.test(entry.name)) {
6262
await walk(fullPath);
6363
}
64-
} else if (fileFilter(fullPath)) {
64+
} else if (fileFilter(path.relative(fullPath, root))) {
6565
try {
6666
const content = await fs.readFile(fullPath, "utf8");
6767

0 commit comments

Comments
 (0)