Skip to content

Commit

Permalink
Update file search to case insensitive
Browse files Browse the repository at this point in the history
Modified the glob pattern in find_largest_file_with_extensions to make file extension search case insensitive.
  • Loading branch information
cbusillo committed Jul 4, 2024
1 parent 73eff0b commit 61ce2e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bd_to_avp/modules/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def sanitize_filename(name: str) -> str:
def find_largest_file_with_extensions(folder: Path, extensions: list[str]) -> Path | None:
files: list[Path] = []
for ext in extensions:
files.extend(folder.glob(f"**/*{ext}"))
files.extend(folder.glob(f"**/*{ext}", case_sensitive=False))

if not files:
print(f"\nNo files found in {folder} with extensions: {extensions}")
Expand Down

0 comments on commit 61ce2e1

Please sign in to comment.