* Builds the list of files to track for recursive watching. * @param {string} dirPath The directory path * @param {string} relativePath The relative path from the watched root
(dirPath, relativePath)
| 245 | * @param {string} relativePath The relative path from the watched root |
| 246 | */ |
| 247 | #buildFileList(dirPath, relativePath) { |
| 248 | try { |
| 249 | const entries = this.#vfs.readdirSync(dirPath, { withFileTypes: true }); |
| 250 | for (const entry of entries) { |
| 251 | const fullPath = join(dirPath, entry.name); |
| 252 | const relPath = relativePath ? join(relativePath, entry.name) : entry.name; |
| 253 | |
| 254 | if (entry.isDirectory()) { |
| 255 | // Recurse into subdirectory |
| 256 | this.#buildFileList(fullPath, relPath); |
| 257 | } else { |
| 258 | // Track the file |
| 259 | const stats = this.#getStatsFor(fullPath); |
| 260 | this.#trackedFiles.set(fullPath, { |
| 261 | stats, |
| 262 | relativePath: relPath, |
| 263 | }); |
| 264 | } |
| 265 | } |
| 266 | } catch { |
| 267 | // Directory might not exist or be readable |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | /** |
| 272 | * Builds a list of direct children to track for non-recursive watching. |
no test coverage detected