From a6e41feed424995009212ae85024983e9345d849 Mon Sep 17 00:00:00 2001 From: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com> Date: Fri, 12 Jul 2024 16:21:56 +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 7f9a1909f9..fad0c44e1d 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())