From 026bae6e12ad53472570b8dcc7b163bc4a2fb0bc Mon Sep 17 00:00:00 2001 From: Christopher Helf Date: Thu, 15 Jun 2023 18:01:59 +0200 Subject: [PATCH] fix: Lock file deletion check --- projects/core/src/utils/file-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/core/src/utils/file-utils.ts b/projects/core/src/utils/file-utils.ts index 27493c3..78d8012 100644 --- a/projects/core/src/utils/file-utils.ts +++ b/projects/core/src/utils/file-utils.ts @@ -77,7 +77,7 @@ export function withFileLock(filePath: string, fn: () => T): T { fs.writeFileSync(lockFilePath, ''); return fn(); } finally { - fs.unlinkSync(lockFilePath); + if (fs.existsSync(lockFilePath)) fs.unlinkSync(lockFilePath); } }