mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 14:25:00 +00:00
aider: Changed call to do_replace
to pass full_path
instead of path
and set full_path
to be an absolute path.
# Context: USER: change the call to do_replace, and pass it full_path instead of path. set full path to be an absolute path formed by combining self.root and path ASSISTANT: To change the call to `do_replace` and pass it `full_path` instead of `path`, and set `full_path` to be an absolute path formed by combining `self.root` and `path`, follow these changes: 1. Create a new variable `full_path` by joining `self.root` and `path`. 2. Update the call to `do_replace` to pass `full_path` instead of `path`. Here are the code changes: ```python aider/coder.py <<<<<<< ORIGINAL edited.add(path) if utils.do_replace(path, original, updated): ======= full_path = os.path.join(self.root, path) edited.add(full_path) if utils.do_replace(full_path, original, updated): >>>>>>> UPDATED self.console.print(f"[red]Applied edit to {path}") else: self.console.print(f"[red]Failed to apply edit to {path}") ```
This commit is contained in:
parent
1fe0f713d4
commit
c725a830b8
1 changed files with 3 additions and 2 deletions
|
@ -362,8 +362,9 @@ class Coder:
|
|||
|
||||
self.fnames.add(path)
|
||||
|
||||
edited.add(path)
|
||||
if utils.do_replace(path, original, updated):
|
||||
full_path = os.path.join(self.root, path)
|
||||
edited.add(full_path)
|
||||
if utils.do_replace(full_path, original, updated):
|
||||
self.console.print(f"[red]Applied edit to {path}")
|
||||
else:
|
||||
self.console.print(f"[red]Failed to apply edit to {path}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue