Commit a1648bd

mo khan <mo@mokhan.ca>
2026-01-22 00:31:42
fix: remove duplicate write in edit tool
1 parent c6af4df
Changed files (1)
lib
elelem
plugins
lib/elelem/plugins/edit.rb
@@ -9,7 +9,6 @@ Elelem::Plugins.register(:edit) do |toolbox|
     path = Pathname.new(a["path"]).expand_path
     content = path.read
     if content.include?(a["old"])
-      path.write(content.sub(a["old"], a["new"]))
       { path: a["path"], bytes: path.write(content.sub(a["old"], a["new"])) }
     else
       { error: "text not found", content: content.lines.first(20).join }