From 8d2f32e652fa8bd4a8bc80fec247f5648d212586 Mon Sep 17 00:00:00 2001 From: Cory Miller <13227161+cory-miller@users.noreply.github.com> Date: Fri, 17 Feb 2023 20:24:10 +0000 Subject: [PATCH] only unlink if still exists --- packages/io/src/io.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/io/src/io.ts b/packages/io/src/io.ts index e122c26f..81213712 100644 --- a/packages/io/src/io.ts +++ b/packages/io/src/io.ts @@ -167,7 +167,9 @@ export async function rmRF(inputPath: string): Promise { 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