diff --git a/scripts/multi_build.py b/scripts/multi_build.py index 80d7dd6..1aefc26 100644 --- a/scripts/multi_build.py +++ b/scripts/multi_build.py @@ -16,12 +16,11 @@ def parse_args() -> None: return parser.parse_args() -def ucopy(src: Path, dst: Path) -> None: - """A universal method to copy files into desired destinations. +def rmove(src: Path, dst: Path) -> None: + """Recusrively move files from one directory to another. :param src: Source path. :param dst: Destination path. - :param exceptions: Elements that will not be removed. """ # for a directory (it's contents) if src.is_dir(): @@ -33,13 +32,10 @@ def ucopy(src: Path, dst: Path) -> None: if e != src: src_e = Path(src, e) dst_e = Path(dst, e) - if src_e.is_dir(): - shutil.copytree(src_e, dst_e) - elif src_e.is_file(): - shutil.copy(src_e, dst_e) + shutil.move(src_e, dst_e) # for a single file elif src.is_file(): - shutil.copy(src, dst) + shutil.move(src, dst) def main(args: argparse.Namespace) -> None: @@ -100,7 +96,7 @@ def main(args: argparse.Namespace) -> None: out = "kernel" case "assets": out = "assets" - ucopy(Path(out), Path(dir_shared)) + rmove(Path(out), Path(dir_shared)) if __name__ == "__main__": diff --git a/wrapper/engines/container.py b/wrapper/engines/container.py index ce7fa0d..ce6c755 100644 --- a/wrapper/engines/container.py +++ b/wrapper/engines/container.py @@ -153,8 +153,7 @@ def _build(self) -> None: msg.note(f"Building the {alias} image..") os.chdir(self._wdir_local) # build only if it is not present in local cache - #if self._name_image not in ccmd.launch(f"{self._buildenv} image list --format '{{.Repository}}'", get_output=True): - if 1 == 1: + if self._name_image not in ccmd.launch(f"{self._buildenv} image list --format '{{.Repository}}'", get_output=True): # force enable Docker Buildkit if self._buildenv == "docker": os.environ["DOCKER_BUILDKIT"] = "1"