handle errors on removing paths on macos if they don't exist

This commit is contained in:
MKLeb 2023-03-10 18:15:24 -05:00 committed by Megan Wilhite
parent 9d80605623
commit 1e319f84fc

View file

@ -350,9 +350,13 @@ def salt_onedir(
pip_bin = onedir_env / "bin" / "pip3"
ctx.run(str(pip_bin), "install", str(salt_archive))
if platform == "darwin":
shutil.rmtree(onedir_env / "opt")
shutil.rmtree(onedir_env / "etc")
shutil.rmtree(onedir_env / "Library")
def errfn(fn, path, err):
ctx.info(f"Removing {path} failed: {err}")
shutil.rmtree(onedir_env / "opt", onerror=errfn)
shutil.rmtree(onedir_env / "etc", onerror=errfn)
shutil.rmtree(onedir_env / "Library", onerror=errfn)
def _check_pkg_build_files_exist(ctx: Context, **kwargs):