mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
Add pattern to .gitignore if user confirms, by appending it to the existing content of the file.
# Aider chat conversation:
This commit is contained in:
parent
c08527dbbc
commit
b0ec8205f3
1 changed files with 4 additions and 2 deletions
|
@ -56,8 +56,10 @@ def check_gitignore(git_root, io):
|
|||
if not io.confirm_ask(f"Add {pat} to .gitignore (recommended)?"):
|
||||
return
|
||||
|
||||
updated_ignore = content + "\n" + pat + "\n"
|
||||
gitignore_file.write_text(updated_ignore, encoding="utf-8")
|
||||
if not content.endswith("\n"):
|
||||
content += "\n"
|
||||
content += pat + "\n"
|
||||
gitignore_file.write_text(content, encoding="utf-8")
|
||||
|
||||
|
||||
def main(args=None, input=None, output=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue