mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45:00 +00:00
feat: Add support for scanning and yielding ```bash blocks in find_original_update_blocks
This commit is contained in:
parent
8b81d4fd45
commit
9dea3f48cb
1 changed files with 10 additions and 0 deletions
|
@ -406,6 +406,16 @@ def find_original_update_blocks(content, fence=DEFAULT_FENCE):
|
||||||
while pieces:
|
while pieces:
|
||||||
cur = pieces.pop()
|
cur = pieces.pop()
|
||||||
|
|
||||||
|
# Check for ```bash blocks
|
||||||
|
if cur.strip().startswith("```bash"):
|
||||||
|
bash_content = []
|
||||||
|
while pieces and not pieces[-1].strip().startswith("```"):
|
||||||
|
bash_content.append(pieces.pop())
|
||||||
|
if pieces and pieces[-1].strip().startswith("```"):
|
||||||
|
pieces.pop() # Remove the closing ```
|
||||||
|
yield "bash_command", "".join(bash_content), ""
|
||||||
|
continue
|
||||||
|
|
||||||
if cur in (DIVIDER, UPDATED):
|
if cur in (DIVIDER, UPDATED):
|
||||||
processed.append(cur)
|
processed.append(cur)
|
||||||
raise ValueError(f"Unexpected {cur}")
|
raise ValueError(f"Unexpected {cur}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue