mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 14:55:00 +00:00
Handle the case where we fail to expand a dir
This commit is contained in:
parent
4024713f31
commit
c4e4d071fa
1 changed files with 6 additions and 2 deletions
|
@ -221,7 +221,8 @@ class Commands:
|
|||
yield Completion(fname, start_position=-len(partial))
|
||||
|
||||
def glob_filtered_to_repo(self, pattern):
|
||||
raw_matched_files = Path(self.coder.root).glob(pattern)
|
||||
raw_matched_files = list(Path(self.coder.root).glob(pattern))
|
||||
|
||||
matched_files = []
|
||||
for fn in raw_matched_files:
|
||||
matched_files += expand_subdir(fn.relative_to(self.coder.root))
|
||||
|
@ -250,7 +251,10 @@ class Commands:
|
|||
self.io.tool_error(f"No files to add matching pattern: {word}")
|
||||
else:
|
||||
if Path(word).exists():
|
||||
if Path(word).is_file():
|
||||
matched_files = [word]
|
||||
else:
|
||||
self.io.tool_error(f"Unable to add: {word}")
|
||||
elif self.io.confirm_ask(
|
||||
f"No files matched '{word}'. Do you want to create the file?"
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue