From eed237f20fdff837654d584fbf0cb2f27762e10c Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Thu, 31 Oct 2024 03:24:22 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20ensure=20fork=20logic=20c?= =?UTF-8?q?hecks=20file=20existence?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/copy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/copy.ts b/packages/core/src/copy.ts index 835dd4a660..b9fffa88c1 100644 --- a/packages/core/src/copy.ts +++ b/packages/core/src/copy.ts @@ -44,7 +44,7 @@ export async function copyPrompt( let fn = promptPath(n) // Handle forking logic by appending a suffix if needed - if (options.fork) { + if (options.fork && (await fileExists(fn))) { let suff = 2 for (;;) { fn = promptPath(n + "_" + suff) // Construct new name with suffix