Commit 147e18d
committed
fix(search): follow symlinks when walking docset directories
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.1 parent bd8af12 commit 147e18d
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
280 | 294 | | |
281 | 295 | | |
282 | 296 | | |
283 | | - | |
| 297 | + | |
284 | 298 | | |
285 | 299 | | |
286 | 300 | | |
287 | 301 | | |
288 | | - | |
289 | | - | |
290 | 302 | | |
291 | 303 | | |
292 | 304 | | |
| |||
0 commit comments