Melkeydev / go-blueprint

Go-blueprint allows users to spin up a quick Go project using a popular framework
https://docs.go-blueprint.dev/
MIT License
5.94k stars 335 forks source link

[Bug] Framework fails to create if git config not set #188

Closed SputNikPlop closed 9 months ago

SputNikPlop commented 9 months ago

What is the problem?

Framework should be created with a warning issued about no default git configs (warnings maybe in color)

Operating System

macOS

Architecture Version (x86, x64, arm, etc)

arm

Steps to reproduce

  1. go-blueprint create --name my-project --framework gin --driver postgres

Relevant log output

go-blueprint create --name my-project --framework gin --driver postgres

 ____  _                       _       _   
|  _ \| |                     (_)     | |  
| |_) | |_   _  ___ _ __  _ __ _ _ __ | |_ 
|  _ <| | | | |/ _ \ '_ \| '__| | '_ \| __|
| |_) | | |_| |  __/ |_) | |  | | | | | |_ 
|____/|_|\__,_|\___| .__/|_|  |_|_| |_|\__|
                   | |                     
                   |_|                     

user.name is not set in git config.
Please set up git config before trying again.
The program encountered an unexpected issue and had to exit. The error was: 
GIT CONFIG ISSUE: user.name is not set in git config.

If you continue to experience this issue, please post a message on our GitHub page or join our Discord server for support.
Ujstor commented 9 months ago

configure your Username and mail for git

git config --global user.name "Your Name" git config --global user.email "[youremail@yourdomain.com]"

SputNikPlop commented 9 months ago

configure your Username and mail for git

git config --global user.name "Your Name" git config --global user.email "[youremail@yourdomain.com]"

I usually use git for work and other fun projects separately so I set it per project not globally. Is there a way to make this work?

Ujstor commented 9 months ago

Not sure, but this is Git specific. Maybe there is a way to manage multiple profiles? After blueprint project is created, it automatically makes an initial commit.

arnevm123 commented 9 months ago

I have this in my .gitconfig:

[user]
    email = globalemail@email.com
    name = Global Name

[includeIf "gitdir:~/Projects/"]
    path = .gitconfig-work

[includeIf "gitdir:~/Personal/"]
    path = .gitconfig-personal

[includeIf "gitdir:~/Tools/"]
    path = .gitconfig-personal

Then you can just create a .gitconfig-work and .gitconfig-work with the correct Username/Email/other settings. This also makes me organise my projects more. Have a seperate folder for work and for others