mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-03 03:05:00 +00:00
simplified append/create
This commit is contained in:
parent
030fe5e179
commit
e4d9e71f5b
1 changed files with 2 additions and 5 deletions
|
@ -170,11 +170,8 @@ def do_replace(fname, before_text, after_text, dry_run=False):
|
||||||
content = fname.read_text()
|
content = fname.read_text()
|
||||||
|
|
||||||
if not before_text.strip():
|
if not before_text.strip():
|
||||||
if content:
|
# append to existing file, or start a new file
|
||||||
new_content = content + after_text
|
new_content = content + after_text
|
||||||
else:
|
|
||||||
# first populating an empty file
|
|
||||||
new_content = after_text
|
|
||||||
else:
|
else:
|
||||||
new_content = replace_most_similar_chunk(content, before_text, after_text)
|
new_content = replace_most_similar_chunk(content, before_text, after_text)
|
||||||
if not new_content:
|
if not new_content:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue