mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +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.")
|
io.tool_output("Git repository created in the current working directory.")
|
||||||
git_root = str(Path.cwd().resolve())
|
git_root = str(Path.cwd().resolve())
|
||||||
check_gitignore(git_root, None)
|
check_gitignore(git_root, io, False)
|
||||||
return git_root
|
return git_root
|
||||||
|
|
||||||
|
|
||||||
def check_gitignore(git_root, io):
|
def check_gitignore(git_root, io, ask=True):
|
||||||
if not git_root:
|
if not git_root:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ def check_gitignore(git_root, io):
|
||||||
else:
|
else:
|
||||||
content = ""
|
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
|
return
|
||||||
|
|
||||||
if content and not content.endswith("\n"):
|
if content and not content.endswith("\n"):
|
||||||
|
@ -64,6 +64,8 @@ def check_gitignore(git_root, io):
|
||||||
content += pat + "\n"
|
content += pat + "\n"
|
||||||
gitignore_file.write_text(content, encoding="utf-8")
|
gitignore_file.write_text(content, encoding="utf-8")
|
||||||
|
|
||||||
|
io.tool_output(f"Added {pat} to .gitignore")
|
||||||
|
|
||||||
|
|
||||||
def main(args=None, input=None, output=None):
|
def main(args=None, input=None, output=None):
|
||||||
if args is None:
|
if args is None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue