feat: add --follow-symlinks option for collection indexing#468
Open
feat: add --follow-symlinks option for collection indexing#468
Conversation
Add per-collection follow_symlinks support so symlinked directories within a collection root are traversed during indexing. - Add --follow-symlinks flag to `qmd collection add` - Persist follow_symlinks in index.yml per collection - Pass the setting through to fast-glob in both CLI and SDK paths - Default remains false (backward compatible) Closes tobi#423
Three tests covering the symlink feature: - Symlinked directories are skipped by default - --follow-symlinks flag enables traversal - Setting persists in index.yml and is respected by qmd update
- Show follow_symlinks setting in 'qmd collection show' output - Add --follow-symlinks example to README Collection Management section
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
qmd collection addandqmd updatedo not traverse symbolic links when scanning for files. Collections whose root directory contains symlinked subdirectories silently skip all files behind those symlinks.Fixes #423.
Solution
Add a per-collection
follow_symlinksoption that controlsfast-glob'sfollowSymbolicLinksbehavior. The setting is:qmd collection add ~/vault --follow-symlinksindex.ymlper collection:collection add(initial index) andqmd update(re-index)false(backward compatible)Changes
src/collections.tsfollow_symlinkstoCollectioninterface,addCollection(), andupdateCollectionSettings()src/store.tsfollowSymlinksoption toreindexCollection(), passes tofast-globsrc/cli/qmd.ts--follow-symlinksCLI flag, threaded throughcollectionAdd()→indexFiles(), updated help textTesting
Verified manually:
--follow-symlinks: symlinked directory skipped (3 files indexed)--follow-symlinks: symlinked directory traversed (4 files indexed)qmd updaterespects the persistedfollow_symlinks: trueconfig