Skip to content

Commit

Permalink
feat(zero-3rdparty): only_files iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
EspenAlbert committed Sep 27, 2023
1 parent 2a70962 commit 93bff16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zero_3rdparty/src/zero_3rdparty/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ def iter_paths(base_dir: Path, *globs: str, rglob=True) -> Iterable[Path]:


def iter_paths_and_relative(
base_dir: Path, *globs: str, rglob=True
base_dir: Path, *globs: str, rglob=True, only_files: bool = False
) -> Iterable[tuple[Path, str]]:
for path in iter_paths(base_dir, *globs, rglob=rglob):
if only_files and not path.is_file():
continue
yield path, str(path.relative_to(base_dir))

0 comments on commit 93bff16

Please sign in to comment.