* Recursively resolve directory entries and collect command file paths
( entry: Dirent, dirPath: string, fileInfo: CommandFileInfo[], depth: number, )
| 73 | * Recursively resolve directory entries and collect command file paths |
| 74 | */ |
| 75 | async function resolveCommandDirectoryEntry( |
| 76 | entry: Dirent, |
| 77 | dirPath: string, |
| 78 | fileInfo: CommandFileInfo[], |
| 79 | depth: number, |
| 80 | ): Promise<void> { |
| 81 | // Avoid cyclic symlinks |
| 82 | if (depth > MAX_DEPTH) { |
| 83 | return |
| 84 | } |
| 85 | |
| 86 | const fullPath = path.resolve(entry.parentPath || dirPath, entry.name) |
| 87 | if (entry.isFile()) { |
| 88 | // Only include markdown files |
| 89 | if (isMarkdownFile(entry.name)) { |
| 90 | // Regular file - both original and resolved paths are the same |
| 91 | fileInfo.push({ originalPath: fullPath, resolvedPath: fullPath }) |
| 92 | } |
| 93 | } else if (entry.isSymbolicLink()) { |
| 94 | // Await the resolution of the symbolic link |
| 95 | await resolveCommandSymLink(fullPath, fileInfo, depth + 1) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Try to resolve a symlinked command file |
no test coverage detected