create-astro 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +7 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -253,8 +253,13 @@ ${bold(
253
253
  if (args.dryRun) {
254
254
  ora().info(dim(`--dry-run enabled, skipping.`));
255
255
  } else if (gitResponse) {
256
- await execaCommand("git init", { cwd });
257
- ora().succeed("Git repository created!");
256
+ const gitDir = "./.git";
257
+ if (fs.existsSync(gitDir)) {
258
+ ora().info(dim("A .git directory already exists. Skipping creating a new Git repository."));
259
+ } else {
260
+ await execaCommand("git init", { cwd });
261
+ ora().succeed("Git repository created!");
262
+ }
258
263
  } else {
259
264
  await info(
260
265
  "Sounds good!",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-astro",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "author": "withastro",
6
6
  "license": "MIT",