(filePath: string, description: string)
| 1549 | // A stat() pre-check would add a syscall and a TOCTOU window where |
| 1550 | // concurrent cleanup causes a false-negative return. |
| 1551 | async function tryRemove(filePath: string, description: string) { |
| 1552 | try { |
| 1553 | await unlink(filePath) |
| 1554 | logForDebugging(`Manually removed ${description}: ${filePath}`) |
| 1555 | return true |
| 1556 | } catch { |
| 1557 | return false |
| 1558 | } |
| 1559 | } |
| 1560 | |
| 1561 | if (getPlatform().startsWith('win32')) { |
| 1562 | // Windows - only remove executables, not the package directory |
no test coverage detected