From b015d2e5367df696d2f4dad555ca871f94afa4cc Mon Sep 17 00:00:00 2001 From: David Langley Date: Fri, 11 Oct 2024 13:48:38 +0100 Subject: [PATCH] Add try catch for each unlink --- src/seshat.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/seshat.ts b/src/seshat.ts index 63fb6dc..fcdd1d7 100644 --- a/src/seshat.ts +++ b/src/seshat.ts @@ -62,7 +62,9 @@ async function getOrCreatePassphrase(key: string): Promise { const deleteContents = async (p: string): Promise => { for (const entry of await afs.readdir(p)) { const curPath = path.join(p, entry); - await afs.unlink(curPath); + try { + await afs.unlink(curPath); + } catch (e) {} } };