MCPcopy Index your code
hub / github.com/shareAI-lab/learn-claude-code / run_edit

Function run_edit

agents/s_full.py:110–119  ·  view source on GitHub ↗
(path: str, old_text: str, new_text: str)

Source from the content-addressed store, hash-verified

108 return f"Error: {e}"
109
110def run_edit(path: str, old_text: str, new_text: str) -> str:
111 try:
112 fp = safe_path(path)
113 c = fp.read_text()
114 if old_text not in c:
115 return f"Error: Text not found in {path}"
116 fp.write_text(c.replace(old_text, new_text, 1))
117 return f"Edited {path}"
118 except Exception as e:
119 return f"Error: {e}"
120
121
122# === SECTION: todos (s03) ===

Callers 3

run_subagentFunction · 0.70
_loopMethod · 0.70
s_full.pyFile · 0.70

Calls 1

safe_pathFunction · 0.70

Tested by

no test coverage detected