36 lines
902 B
Python
36 lines
902 B
Python
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")
|