Skip to content

Commit c3ed7a0

Browse files
authored
chore: simplify making dirs for files (googleapis#14539)
The current logic for making directories can be simplified into a single statement. `exist_ok` also ensures that the command doesn't fail if the directory already exists.
1 parent 5339bcb commit c3ed7a0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

.generator/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,7 @@ def _copy_files_needed_for_post_processing(output: str, input: str, library_id:
309309
path_to_library = f"packages/{library_id}"
310310

311311
# We need to create these directories so that we can copy files necessary for post-processing.
312-
os.makedirs(f"{output}/{path_to_library}")
313-
os.makedirs(f"{output}/{path_to_library}/scripts/client-post-processing")
312+
os.makedirs(f"{output}/{path_to_library}/scripts/client-post-processing", exist_ok=True)
314313
shutil.copy(
315314
f"{input}/{path_to_library}/.repo-metadata.json",
316315
f"{output}/{path_to_library}/.repo-metadata.json",

0 commit comments

Comments
 (0)