Function
removeIfExists
(filePath: string | null)
Source from the content-addressed store, hash-verified
| 1226 | } |
| 1227 | |
| 1228 | async function removeIfExists(filePath: string | null): Promise<void> { |
| 1229 | if (!filePath) { |
| 1230 | return; |
| 1231 | } |
| 1232 | try { |
| 1233 | await fsp.unlink(filePath); |
| 1234 | } catch { |
| 1235 | // Ignore missing files during uninstall. |
| 1236 | } |
| 1237 | } |
| 1238 | |
| 1239 | function assertFileExists(filePath: string | null, label: string): void { |
| 1240 | if (!filePath || !fs.existsSync(filePath)) { |
Tested by
no test coverage detected