ycd / manage-fastapi

:rocket: CLI tool for FastAPI. Generating new FastAPI projects & boilerplates made easy.
https://github.com/ycd/manage-fastapi
MIT License
1.65k stars 106 forks source link

fastapi startproject not works if git is not installed. #127

Open danilovmy opened 1 year ago

danilovmy commented 1 year ago

new windows system. I want work local. i dont need git for my goals.

falls on context.py

# row 43
    def validate_project(cls, values: dict):
        try:
            values["username"] = subprocess.check_output(["git", "config", "--get", "user.name"])
            values["email"] = subprocess.check_output(["git", "config", "--get", "user.email"])
        except subprocess.CalledProcessError:  #(Exception file not found error and not only )
            ... 

my opinion it should be possible to takeinfo from cli:

fastapi startproject myproject --user username --email e@ma.il

in this case it can be:

def validate_project(cls, values: dict):
    try:
        values["username"] = subprocess.check_output(["git", "config", "--get", "user.name"])
        values["email"] = subprocess.check_output(["git", "config", "--get", "user.email"])
    except Exception as error: (Exception file not found error and not only subprocess.CalledProcessError)
        values["email"] = get something from args in cli on start
        values["username"] = get something from args in cli on start
        ...