fix(tools): scope recursive directory ignores to listed root
This commit is contained in:
1 parent
b0d2382856
commit
8052c3a460
2 files changed
+20
-2
No files matched your search
@@ -1174,11 +1174,11 @@ class ListDirTool(_FsTool):
|
||||
|
||||
if recursive:
|
||||
for item in sorted(dp.rglob("*")):
|
||||
if any(p in self._IGNORE_DIRS for p in item.parts):
|
||||
rel = item.relative_to(dp)
|
||||
if any(p in self._IGNORE_DIRS for p in rel.parts):
|
||||
continue
|
||||
total += 1
|
||||
if len(items) < cap:
|
||||
rel = item.relative_to(dp)
|
||||
items.append(f"{rel}/" if item.is_dir() else str(rel))
|
||||
else:
|
||||
for item in sorted(dp.iterdir()):
|
||||
|
||||
Reference in new issue
Block a user