(filePath: string, description: string)
| 1536 | // A stat() pre-check would add a syscall and a TOCTOU window where |
| 1537 | // concurrent cleanup causes a false-negative return. |
| 1538 | async function tryRemove(filePath: string, description: string) { |
| 1539 | try { |
| 1540 | await unlink(filePath) |
| 1541 | logForDebugging(`Manually removed ${description}: ${filePath}`) |
| 1542 | return true |
| 1543 | } catch { |
| 1544 | return false |
| 1545 | } |
| 1546 | } |
| 1547 | |
| 1548 | if (getPlatform().startsWith('win32')) { |
| 1549 | // Windows - only remove executables, not the package directory. |
no test coverage detected