Skip to content

fix(search): follow symlinks when walking docset directories - #30

Merged
mrsimpson merged 1 commit into
mainfrom
actually-search
Mar 10, 2026
Merged

fix(search): follow symlinks when walking docset directories#30
mrsimpson merged 1 commit into
mainfrom
actually-search

Conversation

@mrsimpson

Copy link
Copy Markdown
Collaborator

local_folder docsets are stored as symlinked directories. readdir() withFileTypes returns Dirent objects where isDirectory()/isFile() return false for symlinks — only isSymbolicLink() is true. walkFiles() was therefore skipping all symlinked content, causing files_count: 0.

Fix: when entry.isSymbolicLink(), use stat() (which follows the link) to determine whether the target is a directory or file, then recurse/yield accordingly. Broken symlinks are silently skipped.

local_folder docsets are stored as symlinked directories. readdir()
withFileTypes returns Dirent objects where isDirectory()/isFile() return
false for symlinks — only isSymbolicLink() is true. walkFiles() was
therefore skipping all symlinked content, causing files_count: 0.

Fix: when entry.isSymbolicLink(), use stat() (which follows the link) to
determine whether the target is a directory or file, then recurse/yield
accordingly. Broken symlinks are silently skipped.
@mrsimpson
mrsimpson merged commit 147e18d into main Mar 10, 2026
1 check passed
@mrsimpson
mrsimpson deleted the actually-search branch March 10, 2026 13:03
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.

1 participant