apt-sync: rm dir after mv all files in it

Otherwise tmp_dir.rmdir() would fail as dirs in it
have not been deleted
This commit is contained in:
ZenithalHourlyRate 2021-10-07 22:27:15 +08:00
parent ef3a5bccac
commit f0a7704a0e
No known key found for this signature in database
GPG Key ID: 1189C659F3D04C1C

View File

@ -108,6 +108,7 @@ def move_files_in(src: Path, dst: Path):
if file.is_dir():
(dst / file.name).mkdir(parents=True, exist_ok=True)
move_files_in(file, dst / file.name)
file.rmdir() # rmdir wont fail as all files in it have been moved
else:
file.rename(dst / file.name) # Overwrite files
if empty: