From 9365f5270a07cb274c4a6eebf45802bf33143624 Mon Sep 17 00:00:00 2001 From: Minionguyjpro Date: Sat, 12 Oct 2024 19:27:31 +0200 Subject: [PATCH] src/index.js: Another fix --- src/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 7273f7c..632603a 100644 --- a/src/index.js +++ b/src/index.js @@ -12,7 +12,14 @@ let platformError; async function run() { try { if (process.platform === "win32") { - const workspaceExists = await fs.access(workspacePath).then(() => true).catch(() => false); + let workspaceExists; + try { + await fs.access(workspacePath); + workspaceExists = true; + } catch { + workspaceExists = false; + } + const workspaceNotEmpty = (await fs.readdir(workspacePath)).length > 0; if (workspaceExists && workspaceNotEmpty) {