Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .generator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,13 @@ def _copy_files_needed_for_post_processing(
path_to_library = f"packages/{library_id}" if is_mono_repo else "."
source_dir = f"{input}/{path_to_library}"

shutil.copytree(
source_dir,
output,
dirs_exist_ok=True,
ignore=shutil.ignore_patterns("client-post-processing"),
)
if Path(source_dir).exists():
shutil.copytree(
source_dir,
output,
dirs_exist_ok=True,
ignore=shutil.ignore_patterns("client-post-processing"),
)

# We need to create these directories so that we can copy files necessary for post-processing.
os.makedirs(
Expand Down
1 change: 1 addition & 0 deletions .generator/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ def test_copy_files_needed_for_post_processing_copies_files_from_generator_input
"""Tests that .repo-metadata.json is copied if it exists."""
mock_makedirs = mocker.patch("os.makedirs")
mock_shutil_copytree = mocker.patch("shutil.copytree")
mocker.patch("pathlib.Path.exists", return_value=True)

_copy_files_needed_for_post_processing(
"output", "input", "library_id", is_mono_repo
Expand Down
Loading