From 9ef3030349111b47ac871dc500214e1cf80c62d1 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:53:45 +0200 Subject: [PATCH] fix copy in create package --- create_package.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/create_package.py b/create_package.py index 7f9a190..fad0c44 100644 --- a/create_package.py +++ b/create_package.py @@ -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) @@ -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())