make .gitignore before making repo

This commit is contained in:
Paul Gauthier 2023-07-22 08:51:57 -03:00
parent 61565b66e1
commit 4e40c8ac15

View file

@ -27,6 +27,10 @@ def setup_git(git_root, io):
if not io.confirm_ask("No git repo found, create one to track GPT's changes (recommended)?"):
return
git_root = str(Path.cwd().resolve())
check_gitignore(git_root, io, False)
repo = git.Repo.init(Path.cwd())
global_git_config = git.GitConfigParser([str(Path.home() / ".gitconfig")], read_only=True)
with repo.config_writer() as git_config:
@ -38,8 +42,7 @@ def setup_git(git_root, io):
io.tool_error('Update git email with: git config --global user.email "you@example.com"')
io.tool_output("Git repository created in the current working directory.")
git_root = str(Path.cwd().resolve())
check_gitignore(git_root, io, False)
return git_root