mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
fix: Simplify file matching logic in commands.py
This commit is contained in:
parent
9570d71b13
commit
9584a7f296
1 changed files with 6 additions and 8 deletions
|
@ -1037,14 +1037,12 @@ class Commands:
|
||||||
|
|
||||||
filenames = parse_quoted_filenames(args)
|
filenames = parse_quoted_filenames(args)
|
||||||
for word in filenames:
|
for word in filenames:
|
||||||
matched_files = self.glob_filtered_to_repo(word)
|
# If no files matched, try to use the word as a direct file path
|
||||||
if not matched_files:
|
if os.path.exists(word) and os.path.isfile(word):
|
||||||
# If no files matched, try to use the word as a direct file path
|
matched_files = [word]
|
||||||
if os.path.exists(word) and os.path.isfile(word):
|
else:
|
||||||
matched_files = [word]
|
self.io.tool_error(f"No files matched '{word}'.")
|
||||||
else:
|
continue
|
||||||
self.io.tool_error(f"No files matched '{word}'.")
|
|
||||||
continue
|
|
||||||
|
|
||||||
for matched_file in matched_files:
|
for matched_file in matched_files:
|
||||||
abs_path = self.coder.abs_root_path(matched_file)
|
abs_path = self.coder.abs_root_path(matched_file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue