From cccd56b83aa5eed4b1f0d0c171e47ef2db7d9861 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 8 Dec 2023 22:51:40 +0000 Subject: [PATCH] C3: Don't show `cd` instructions when the user is creating a project in the current directory (#4579) --- .changeset/sour-dots-hunt.md | 5 +++++ packages/create-cloudflare/src/common.ts | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/sour-dots-hunt.md diff --git a/.changeset/sour-dots-hunt.md b/.changeset/sour-dots-hunt.md new file mode 100644 index 000000000000..21496c48c4e4 --- /dev/null +++ b/.changeset/sour-dots-hunt.md @@ -0,0 +1,5 @@ +--- +"create-cloudflare": patch +--- + +Don't show `cd` instructions when the user is creating a project in the current directory diff --git a/packages/create-cloudflare/src/common.ts b/packages/create-cloudflare/src/common.ts index 89ef8fec9777..5668a6fe60ca 100644 --- a/packages/create-cloudflare/src/common.ts +++ b/packages/create-cloudflare/src/common.ts @@ -251,11 +251,12 @@ export const chooseAccount = async (ctx: PagesGeneratorContext) => { }; export const printSummary = async (ctx: PagesGeneratorContext) => { + const dirRelativePath = relative(ctx.originalCWD, ctx.project.path); + const nextSteps = [ - [ - `Navigate to the new directory`, - `cd ${relative(ctx.originalCWD, ctx.project.path)}`, - ], + ...(dirRelativePath + ? [`Navigate to the new directory`, `cd ${dirRelativePath}`] + : []), [ `Run the development server`, quoteShellArgs([