Skip to content

Commit

Permalink
Merge pull request #40 from ynput/bugfix/fix-copy-in-create-package
Browse files Browse the repository at this point in the history
Chore: Fix copy in create package
  • Loading branch information
iLLiCiTiT authored Jul 15, 2024
2 parents 077af32 + 22fcd0d commit bb5eb07
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 bb5eb07

Please sign in to comment.