(ctx: Context)
| 515 | } |
| 516 | |
| 517 | async function gitInitStep(ctx: Context) { |
| 518 | if (!ctx.git) { |
| 519 | return; |
| 520 | } |
| 521 | |
| 522 | if (existsSync(path.join(ctx.cwd, ".git"))) { |
| 523 | log(""); |
| 524 | info("Nice!", `Git has already been initialized`); |
| 525 | return; |
| 526 | } |
| 527 | |
| 528 | log(""); |
| 529 | await loadingIndicator({ |
| 530 | start: "Git initializing...", |
| 531 | end: "Git initialized", |
| 532 | while: async () => { |
| 533 | let options = { cwd: ctx.cwd, stdio: "ignore" } as const; |
| 534 | let commitMsg = "Initial commit from create-react-router"; |
| 535 | try { |
| 536 | await runCommand("git", ["init"], options); |
| 537 | await runCommand("git", ["add", "."], options); |
| 538 | await runCommand("git", ["commit", "-m", commitMsg], options); |
| 539 | } catch (err) { |
| 540 | error("Oh no!", "Failed to initialize git."); |
| 541 | throw err; |
| 542 | } |
| 543 | }, |
| 544 | ctx, |
| 545 | }); |
| 546 | } |
| 547 | |
| 548 | async function doneStep(ctx: Context) { |
| 549 | let projectDir = path.relative(process.cwd(), ctx.cwd); |
nothing calls this directly
no test coverage detected
searching dependent graphs…