mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
refactor: extract get_rel_fname function for path resolution
This commit is contained in:
parent
be74259df6
commit
9edf9b4186
1 changed files with 8 additions and 1 deletions
|
@ -360,7 +360,7 @@ class InputOutput:
|
||||||
show = ""
|
show = ""
|
||||||
if rel_fnames:
|
if rel_fnames:
|
||||||
rel_read_only_fnames = [
|
rel_read_only_fnames = [
|
||||||
os.path.relpath(fname, root) for fname in (abs_read_only_fnames or [])
|
get_rel_fname(fname, root) for fname in (abs_read_only_fnames or [])
|
||||||
]
|
]
|
||||||
show = self.format_files_for_input(rel_fnames, rel_read_only_fnames)
|
show = self.format_files_for_input(rel_fnames, rel_read_only_fnames)
|
||||||
if edit_format:
|
if edit_format:
|
||||||
|
@ -712,3 +712,10 @@ class InputOutput:
|
||||||
editable_files.append(f"{full_path}")
|
editable_files.append(f"{full_path}")
|
||||||
|
|
||||||
return "\n".join(read_only_files + editable_files) + "\n"
|
return "\n".join(read_only_files + editable_files) + "\n"
|
||||||
|
|
||||||
|
|
||||||
|
def get_rel_fname(self, fname, root):
|
||||||
|
try:
|
||||||
|
return os.path.relpath(fname, root)
|
||||||
|
except ValueError:
|
||||||
|
return fname
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue