Apply patch [skip ci]

This commit is contained in:
open-swe-dev-andrinoid[bot] 2026-01-20 16:46:39 +00:00
parent 0f8aba9dd1
commit 5d17aeea63

35
fix_agents.py Normal file
View File

@ -0,0 +1,35 @@
import re
correct_block = """1. Install Deno:
```bash
curl -LO https://github.com/denoland/deno/releases/latest/download/deno-x86_64-unknown-linux-gnu.zip
unzip deno-x86_64-unknown-linux-gnu.zip
sudo mv deno /usr/local/bin/
rm deno-x86_64-unknown-linux-gnu.zip
```
"""
with open('AGENTS.md', 'r') as f:
lines = f.readlines()
new_lines = []
skip = False
found = False
for line in lines:
if line.strip().startswith('1. Install Deno:'):
new_lines.append(correct_block)
skip = True
found = True
elif skip and line.strip().startswith('2. Clone repository'):
skip = False
new_lines.append(line)
elif not skip:
new_lines.append(line)
if found:
with open('AGENTS.md', 'w') as f:
f.writelines(new_lines)
print("Successfully fixed AGENTS.md")
else:
print("Could not find the target section in AGENTS.md")