From e8511f5bab4fe4d3bda820e2961bfdee95852119 Mon Sep 17 00:00:00 2001 From: gioboa Date: Sun, 24 Aug 2025 00:06:15 +0200 Subject: [PATCH 1/3] =?UTF-8?q?fix(create):=20clean=20up=20tmp=20folder=20?= =?UTF-8?q?before=20exit=20=F0=9F=98=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../create-qwik/src/run-create-interactive-cli.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/create-qwik/src/run-create-interactive-cli.ts b/packages/create-qwik/src/run-create-interactive-cli.ts index 71b5f172789..9d00f8c220b 100644 --- a/packages/create-qwik/src/run-create-interactive-cli.ts +++ b/packages/create-qwik/src/run-create-interactive-cli.ts @@ -53,6 +53,12 @@ export async function runCreateInteractiveCli(): Promise { const backgroundInstall = backgroundInstallDeps(pkgManager, baseApp); + const cancelProcess = () => { + backgroundInstall.abort(); + cancel('Operation cancelled.'); + process.exit(0); + }; + log.info(`Creating new project in ${bgBlue(' ' + outDir + ' ')} ... 🐇`); let removeExistingOutDirPromise: Promise | null = null; @@ -70,8 +76,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(existingOutDirAnswer) || existingOutDirAnswer === 'exit') { - cancel('Operation cancelled.'); - process.exit(0); + cancelProcess(); } if (existingOutDirAnswer === 'replace') { @@ -86,8 +91,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(starterIdAnswer)) { - cancel('Operation cancelled.'); - process.exit(0); + cancelProcess(); } const starterId = starterIdAnswer as string; @@ -98,8 +102,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(runDepInstallAnswer)) { - cancel('Operation cancelled.'); - process.exit(0); + cancelProcess(); } const gitInitAnswer = await confirm({ From 3469e1639baa876062f637e4de5c157f18d2f6e7 Mon Sep 17 00:00:00 2001 From: gioboa Date: Sun, 24 Aug 2025 00:15:39 +0200 Subject: [PATCH 2/3] chore: fix up typo --- packages/create-qwik/src/run-create-interactive-cli.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/create-qwik/src/run-create-interactive-cli.ts b/packages/create-qwik/src/run-create-interactive-cli.ts index 9d00f8c220b..63e6c07c4c7 100644 --- a/packages/create-qwik/src/run-create-interactive-cli.ts +++ b/packages/create-qwik/src/run-create-interactive-cli.ts @@ -76,7 +76,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(existingOutDirAnswer) || existingOutDirAnswer === 'exit') { - cancelProcess(); + return cancelProcess(); } if (existingOutDirAnswer === 'replace') { @@ -91,7 +91,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(starterIdAnswer)) { - cancelProcess(); + return cancelProcess(); } const starterId = starterIdAnswer as string; @@ -102,7 +102,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(runDepInstallAnswer)) { - cancelProcess(); + return cancelProcess(); } const gitInitAnswer = await confirm({ From 3dd0e4cc3e80ac55961442d4dd85efa2228e4e5d Mon Sep 17 00:00:00 2001 From: gioboa Date: Sun, 24 Aug 2025 00:53:55 +0200 Subject: [PATCH 3/3] chore: add async await --- packages/create-qwik/src/run-create-interactive-cli.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/create-qwik/src/run-create-interactive-cli.ts b/packages/create-qwik/src/run-create-interactive-cli.ts index 63e6c07c4c7..8f909c1e542 100644 --- a/packages/create-qwik/src/run-create-interactive-cli.ts +++ b/packages/create-qwik/src/run-create-interactive-cli.ts @@ -53,8 +53,8 @@ export async function runCreateInteractiveCli(): Promise { const backgroundInstall = backgroundInstallDeps(pkgManager, baseApp); - const cancelProcess = () => { - backgroundInstall.abort(); + const cancelProcess = async () => { + await backgroundInstall.abort(); cancel('Operation cancelled.'); process.exit(0); }; @@ -76,7 +76,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(existingOutDirAnswer) || existingOutDirAnswer === 'exit') { - return cancelProcess(); + return await cancelProcess(); } if (existingOutDirAnswer === 'replace') { @@ -91,7 +91,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(starterIdAnswer)) { - return cancelProcess(); + return await cancelProcess(); } const starterId = starterIdAnswer as string; @@ -102,7 +102,7 @@ export async function runCreateInteractiveCli(): Promise { }); if (isCancel(runDepInstallAnswer)) { - return cancelProcess(); + return await cancelProcess(); } const gitInitAnswer = await confirm({