Skip to content

Commit

Permalink
fix copy in create package
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Jul 12, 2024
1 parent 68ec921 commit fded154
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions create_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,7 @@ def safe_copy_file(src_path: str, dst_path: str):
return

dst_dir: str = os.path.dirname(dst_path)
try:
os.makedirs(dst_dir)
except Exception:
pass
os.makedirs(dst_dir, exist_ok=True)

shutil.copy2(src_path, dst_path)

Expand Down Expand Up @@ -355,6 +352,8 @@ def copy_addon_package(
# Copy server content
for src_file, dst_subpath in files_mapping:
dst_path: str = os.path.join(addon_output_dir, dst_subpath)
dst_dir: str = os.path.dirname(dst_path)
os.makedirs(dst_dir, exist_ok=True)
if isinstance(src_file, io.BytesIO):
with open(dst_path, "wb") as stream:
stream.write(src_file.getvalue())
Expand Down

0 comments on commit fded154

Please sign in to comment.