diff --git a/fix_agents.py b/fix_agents.py new file mode 100644 index 0000000..e941137 --- /dev/null +++ b/fix_agents.py @@ -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")