Skip to content

Commit d166cc6

Browse files
committed
fix(cli): default to recursive when glob matching **
1 parent d990b84 commit d166cc6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/vectorcode/cli_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,8 @@ async def expand_globs(
444444
curr = stack.pop()
445445
if os.path.isfile(curr):
446446
result.add(expand_path(curr))
447+
elif "**" in str(curr):
448+
stack.extend(glob.glob(str(curr), recursive=True))
447449
elif "*" in str(curr):
448450
stack.extend(glob.glob(str(curr), recursive=recursive))
449451
elif os.path.isdir(curr) and recursive:

tests/test_cli_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ async def test_expand_globs():
166166
assert len(expanded_paths) == 1
167167
assert file2_path in expanded_paths
168168

169+
assert len(await expand_globs([os.path.join(temp_dir, "**", "*.txt")])) == 3
170+
169171

170172
def test_expand_path():
171173
path_with_user = "~/test_dir"

0 commit comments

Comments
 (0)