Skip to content

Commit 35165a2

Browse files
authored
C3: Fixing double prompt for ts during hello world worker creation (#4088)
* C3: Fixing double prompt for ts during hello world worker creation * changeset
1 parent 3e9e2f5 commit 35165a2

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

.changeset/eighty-plums-ring.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-cloudflare": patch
3+
---
4+
5+
Fixes an issue where users were prompted for TypeScript twice during worker creation

packages/create-cloudflare/src/workers.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ export const runWorkersGenerator = async (args: C3Args) => {
4242
args,
4343
};
4444

45+
ctx.args.ts = await processArgument<boolean>(ctx.args, "ts", {
46+
type: "confirm",
47+
question: "Do you want to use TypeScript?",
48+
label: "typescript",
49+
defaultValue: C3_DEFAULTS.ts,
50+
});
51+
4552
await copyFiles(ctx);
4653
await copyExistingWorkerFiles(ctx);
4754
await updateFiles(ctx);
@@ -61,13 +68,6 @@ export const runWorkersGenerator = async (args: C3Args) => {
6168
};
6269

6370
async function getTemplate(ctx: Context) {
64-
ctx.args.ts = await processArgument<boolean>(ctx.args, "ts", {
65-
type: "confirm",
66-
question: "Do you want to use TypeScript?",
67-
label: "typescript",
68-
defaultValue: C3_DEFAULTS.ts,
69-
});
70-
7171
const preexisting = ctx.args.type === "pre-existing";
7272
const template = preexisting ? "hello-world" : ctx.args.type;
7373
const path = resolve(

0 commit comments

Comments
 (0)