mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
print when greating gitignore
This commit is contained in:
parent
402f8f4971
commit
4b01f20b73
1 changed files with 5 additions and 3 deletions
|
@ -38,11 +38,11 @@ def setup_git(git_root, io):
|
|||
|
||||
io.tool_output("Git repository created in the current working directory.")
|
||||
git_root = str(Path.cwd().resolve())
|
||||
check_gitignore(git_root, None)
|
||||
check_gitignore(git_root, io, False)
|
||||
return git_root
|
||||
|
||||
|
||||
def check_gitignore(git_root, io):
|
||||
def check_gitignore(git_root, io, ask=True):
|
||||
if not git_root:
|
||||
return
|
||||
|
||||
|
@ -56,7 +56,7 @@ def check_gitignore(git_root, io):
|
|||
else:
|
||||
content = ""
|
||||
|
||||
if io and not io.confirm_ask(f"Add {pat} to .gitignore (recommended)?"):
|
||||
if ask and not io.confirm_ask(f"Add {pat} to .gitignore (recommended)?"):
|
||||
return
|
||||
|
||||
if content and not content.endswith("\n"):
|
||||
|
@ -64,6 +64,8 @@ def check_gitignore(git_root, io):
|
|||
content += pat + "\n"
|
||||
gitignore_file.write_text(content, encoding="utf-8")
|
||||
|
||||
io.tool_output(f"Added {pat} to .gitignore")
|
||||
|
||||
|
||||
def main(args=None, input=None, output=None):
|
||||
if args is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue