sys_patch.py: Ensure path is empty when moving

This commit is contained in:
Mykola Grymalyuk
2022-10-30 14:02:26 -06:00
parent 2ea982b343
commit d2d68fd08f

View File

@@ -368,6 +368,8 @@ class PatchSysVolume:
for file in Path("/Library/Extensions").glob("*.kext"):
if datetime.fromtimestamp(file.stat().st_mtime) < datetime(2021, 10, 1):
print(f" - Relocating {file.name} kext to {relocation_path}")
if Path(relocation_path) / Path(file.name).exists():
utilities.elevated(["rm", "-Rf", relocation_path / Path(file.name)])
utilities.elevated(["mv", file, relocation_path])
def write_patchset(self, patchset):