Skip to content

fix(extract): skip _-prefixed directories in FS walker (#202)#263

Open
JiayuuWang wants to merge 1 commit into
garrytan:masterfrom
JiayuuWang:contribot/fix-extract-walker
Open

fix(extract): skip _-prefixed directories in FS walker (#202)#263
JiayuuWang wants to merge 1 commit into
garrytan:masterfrom
JiayuuWang:contribot/fix-extract-walker

Conversation

@JiayuuWang

Copy link
Copy Markdown

Summary

walkMarkdownFiles() in src/commands/extract.ts skips leading-underscore files (e.g., _drafts/foo.md) but was not skipping leading-underscore directories (e.g., _pending/, _drafts/). This caused extract to walk quarantine directories that sync correctly skips via isSyncable().

Fix

Added if (entry.startsWith('_')) continue; before the directory recursion check, matching the file-level exclusion already present.

Test

Added a test case that creates a _pending/ directory with a markdown file and asserts pages_processed === 2 (not 3) when running extract with --dry-run --json.

Closes #202.

The FS walker in walkMarkdownFiles() skipped underscore-prefixed files
but not underscore-prefixed directories, causing _pending/, _drafts/, etc.
to be walked even though sync skips them via isSyncable().

Issue garrytan#202
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

extract: --source fs walker does not respect isSyncable prefix exclusions

1 participant