| 494 | } |
| 495 | |
| 496 | async function gitInitQuestionStep(ctx: Context) { |
| 497 | if (existsSync(path.join(ctx.cwd, ".git"))) { |
| 498 | info("Nice!", `Git has already been initialized`); |
| 499 | return; |
| 500 | } |
| 501 | |
| 502 | let git = ctx.git; |
| 503 | if (ctx.git === undefined) { |
| 504 | ({ git } = await ctx.prompt({ |
| 505 | name: "git", |
| 506 | type: "confirm", |
| 507 | label: title("git"), |
| 508 | message: `Initialize a new git repository?`, |
| 509 | hint: "recommended", |
| 510 | initial: true, |
| 511 | })); |
| 512 | } |
| 513 | |
| 514 | ctx.git = git ?? false; |
| 515 | } |
| 516 | |
| 517 | async function gitInitStep(ctx: Context) { |
| 518 | if (!ctx.git) { |