1
0
Fork 0

only unlink if still exists

pull/1344/head
Cory Miller 2023-02-17 20:24:10 +00:00
parent 35cba88c68
commit 8d2f32e652
1 changed files with 3 additions and 1 deletions

View File

@ -167,7 +167,9 @@ export async function rmRF(inputPath: string): Promise<void> {
console.log('b')
// Shelling out fails to remove a symlink folder with missing source, this unlink catches that
try {
await ioUtil.unlink(inputPath)
if (ioUtil.exists(inputPath)) {
await ioUtil.unlink(inputPath)
}
} catch (err) {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid