From 674c6b4fd796ca03bad45246512526e4ccf759e4 Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Sat, 20 Jul 2024 18:42:34 +0300 Subject: [PATCH] Ignore missing build directory --- package_build/package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package_build/package.py b/package_build/package.py index d451322..25674e1 100644 --- a/package_build/package.py +++ b/package_build/package.py @@ -5,6 +5,7 @@ from package_build.download_parts import DownloadedParts from package_build.models import HookInfoEntry +import contextlib def zip_directory(directory: Path, filename: Path) -> None: @@ -21,7 +22,9 @@ def build_package( parts: DownloadedParts, is_win: bool, ) -> None: - shutil.rmtree(build_dir) + with contextlib.suppress(FileNotFoundError): + shutil.rmtree(build_dir) + build_dir.mkdir(parents=True) package_path.unlink(missing_ok=True)