akd-io / create-next-stack

Create Next Stack is a website and CLI tool used to easily set up the boilerplate of new Next.js apps.
https://www.create-next-stack.com
MIT License
561 stars 27 forks source link

CLI crashes if git username and email isn't specified #231

Open akd-io opened 1 year ago

akd-io commented 1 year ago

I believe the CLI crashes if the user hasn't set their username and email in the git config, when the cli tries to create the initial commit.

I think create-next-app handles this case without problems, just ignoring git. We should probably check for user.name and email before amending create-next-app with our initial commit.

Get username with git config --global user.name Get email with git config --global user.email Set username with git config --global user.name "example user name" Set email with git config --global user.email "example@user.email"

akd-io commented 1 year ago

I think create-next-app handles this case without problems, just ignoring git.

Doesn't seem to be the case according to this line in test.ts:

// If not done already, Set Git name and email so `git commit` doesn't fail during create-next-app
await setGitNameAndEmail()

Research and fix any problems that arise