From 5d3a60228c2884f259d8f34733b5bbffaf6c23da Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 25 Oct 2024 07:43:29 -0700 Subject: [PATCH] fix: use Path.rglob instead of glob.glob for recursive file matching --- aider/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index 3694c59ee..01374dbe1 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1170,7 +1170,8 @@ class Commands: # First collect all expanded paths for pattern in filenames: expanded_pattern = expanduser(pattern) - expanded_paths = glob.glob(expanded_pattern, recursive=True, root_dir=self.coder.root) + expanded_paths = Path(self.coder.root).rglob(expanded_pattern) + if not expanded_paths: self.io.tool_error(f"No matches found for: {pattern}") else: