Apply patch [skip ci]
This commit is contained in:
parent
a255cfabde
commit
27bac30445
@ -1,35 +0,0 @@
|
||||
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")
|
||||
Loading…
x
Reference in New Issue
Block a user