Skip to content

Commit 103b7ea

Browse files
committed
Filter hidden files when copying repo sources
1 parent c4a6798 commit 103b7ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pulp_docs/repository.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ def download(self, dest_dir: Path, clear_cache: bool = False) -> str:
126126
# copy from source/cache to pulp-docs workdir
127127
log.info(f"{log_header}: source={download_from}, copied_from={src_copy_path}")
128128

129-
gitignore_files = get_git_ignored_files(Path(src_copy_path))
129+
# ignore files lisetd in .gitignore and files that starts with "."
130+
ignore_patterns = get_git_ignored_files(Path(src_copy_path)) + [".*"]
130131
shutil.copytree(
131132
src_copy_path,
132133
dest_dir,
133-
ignore=shutil.ignore_patterns(*gitignore_files),
134+
ignore=shutil.ignore_patterns(*ignore_patterns),
134135
)
135136

136137
self.status.download_source = str(download_from)

0 commit comments

Comments
 (0)