mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
style: fix line length and whitespace in gitignore handling
This commit is contained in:
parent
2e7c5d6cfa
commit
f45533e20b
1 changed files with 4 additions and 2 deletions
|
@ -177,13 +177,15 @@ def check_gitignore(git_root, io, ask=True):
|
||||||
if content and not content.endswith("\n"):
|
if content and not content.endswith("\n"):
|
||||||
content += "\n"
|
content += "\n"
|
||||||
content += "\n".join(patterns_to_add) + "\n"
|
content += "\n".join(patterns_to_add) + "\n"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
io.write_text(gitignore_file, content)
|
io.write_text(gitignore_file, content)
|
||||||
io.tool_output(f"Added {', '.join(patterns_to_add)} to .gitignore")
|
io.tool_output(f"Added {', '.join(patterns_to_add)} to .gitignore")
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
io.tool_error(f"Permission denied when trying to write to {gitignore_file}")
|
io.tool_error(f"Permission denied when trying to write to {gitignore_file}")
|
||||||
io.tool_output("Try running with appropriate permissions or manually add these patterns to .gitignore:")
|
io.tool_output(
|
||||||
|
"Try running with appropriate permissions or manually add these patterns to .gitignore:"
|
||||||
|
)
|
||||||
for pattern in patterns_to_add:
|
for pattern in patterns_to_add:
|
||||||
io.tool_output(f" {pattern}")
|
io.tool_output(f" {pattern}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue