Skip to content

Commit

Permalink
Filter hidden files when copying repo sources
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-psb committed Mar 21, 2024
1 parent c4a6798 commit 103b7ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pulp_docs/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,12 @@ def download(self, dest_dir: Path, clear_cache: bool = False) -> str:
# copy from source/cache to pulp-docs workdir
log.info(f"{log_header}: source={download_from}, copied_from={src_copy_path}")

gitignore_files = get_git_ignored_files(Path(src_copy_path))
# ignore files lisetd in .gitignore and files that starts with "."
ignore_patterns = get_git_ignored_files(Path(src_copy_path)) + [".*"]
shutil.copytree(
src_copy_path,
dest_dir,
ignore=shutil.ignore_patterns(*gitignore_files),
ignore=shutil.ignore_patterns(*ignore_patterns),
)

self.status.download_source = str(download_from)
Expand Down

0 comments on commit 103b7ea

Please sign in to comment.