(filePath: string, emptied: string)
| 196 | * (#2721). |
| 197 | */ |
| 198 | export function removeFileUnlessLinked(filePath: string, emptied: string): void { |
| 199 | if (isSymbolicLink(filePath)) { |
| 200 | atomicWriteFileSync(filePath, emptied); |
| 201 | return; |
| 202 | } |
| 203 | try { fs.unlinkSync(filePath); } catch { /* ignore */ } |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Copy a file we're about to overwrite to `<path>.backup` when it isn't |
no test coverage detected