From 90320e90782ba943451835ebf3face7491edb167 Mon Sep 17 00:00:00 2001 From: kirinnee Date: Tue, 14 Nov 2023 21:35:11 +0800 Subject: [PATCH] fix: cloning into existing repository --- cyan/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cyan/index.ts b/cyan/index.ts index 9d8c244..e1d3a01 100644 --- a/cyan/index.ts +++ b/cyan/index.ts @@ -8,9 +8,10 @@ StartTemplateWithLambda(async (i, d) => { const url = await i.text("CookieCutter Git URL"); const tmpPath = d.get("tmpPath", () => `/tmp/cookiecutter/${v4()}`); - if (!fs.existsSync(tmpPath)) fs.mkdirSync(tmpPath, { recursive: true }); - - await git.clone(url, tmpPath); + if (!fs.existsSync(tmpPath)) { + fs.mkdirSync(tmpPath, { recursive: true }); + await git.clone(url, tmpPath); + } const cookieCutterJson = fs.readFileSync( `${tmpPath}/cookiecutter.json`,