From 1ec6e1a68d00e49dc36b956764bd76956d9f5a15 Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:14:38 -0400 Subject: [PATCH] ci/nur/combine.py: Try to fix `File exists: 'lib'` error --- ci/nur/combine.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ci/nur/combine.py b/ci/nur/combine.py index 5e0df2906..7cb05e445 100644 --- a/ci/nur/combine.py +++ b/ci/nur/combine.py @@ -50,7 +50,9 @@ def commit_repo(repo: Repo, message: str, path: Path) -> Repo: assert tmp is not None try: - shutil.copytree(repo_source(repo.name), tmp.name, symlinks=True) + shutil.copytree( + repo_source(repo.name), tmp.name, symlinks=True, dirs_exist_ok=True + ) shutil.rmtree(repo_path, ignore_errors=True) os.rename(tmp.name, repo_path) tmp = None @@ -159,7 +161,9 @@ def setup_combined() -> None: write_json_file(dict(repos={}), manifest_path) manifest_lib = "lib" - shutil.copytree(str(ROOT.joinpath("lib")), manifest_lib, symlinks=True) + shutil.copytree( + str(ROOT.joinpath("lib")), manifest_lib, symlinks=True, dirs_exist_ok=True + ) default_nix = "default.nix" shutil.copy(ROOT.joinpath("default.nix"), default_nix)