(targetPath)
| 299 | |
| 300 | async function cleanup() { |
| 301 | const removeWithRetry = async (targetPath) => { |
| 302 | for (let attempt = 0; attempt <= CLEANUP_MAX_RETRIES; attempt++) { |
| 303 | try { |
| 304 | await fs.rm(targetPath, { |
| 305 | recursive: true, |
| 306 | force: true, |
| 307 | }); |
| 308 | return; |
| 309 | } catch (error) { |
| 310 | const shouldRetry = |
| 311 | (error?.code === 'ENOTEMPTY' || error?.code === 'EBUSY') && |
| 312 | attempt < CLEANUP_MAX_RETRIES; |
| 313 | |
| 314 | if (!shouldRetry) throw error; |
| 315 | |
| 316 | await new Promise((resolve) => setTimeout(resolve, CLEANUP_RETRY_DELAY_MS)); |
| 317 | } |
| 318 | } |
| 319 | }; |
| 320 | |
| 321 | for (const dir of buildDirs) { |
| 322 | await removeWithRetry(path.join(packageRootDir, dir)); |
no outgoing calls
no test coverage detected
searching dependent graphs…