[create-astro] Execute the 'git' step as the final interaction (#6314)

* [create-astro] Execute the 'git' step as the final interaction

This ensures the initialized repository has all configuration
changes commited in the first commit

* Add changeset
This commit is contained in:
Miles Pernicious 2023-02-21 06:48:06 -10:00 committed by GitHub
parent d0dbee872f
commit 7f61e8fe36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'create-astro': patch
---
Prompt for git initialization last, so all configurations can get added to the initial commit

View file

@ -29,7 +29,17 @@ export async function main() {
return;
}
const steps = [intro, projectName, template, dependencies, git, typescript, next];
const steps = [
intro,
projectName,
template,
dependencies,
typescript,
// Steps which write to files need to go above git
git,
next
];
for (const step of steps) {
await step(ctx);