From 5901d7484c21b03ee953602187c335b4b5a080dc Mon Sep 17 00:00:00 2001 From: z4yx Date: Sun, 19 Apr 2020 17:58:05 +0800 Subject: [PATCH] use Path.rename to overwrite --- apt-sync.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apt-sync.py b/apt-sync.py index b78203b..0ab7a30 100755 --- a/apt-sync.py +++ b/apt-sync.py @@ -85,7 +85,8 @@ def move_files_in(src: Path, dst: Path): for file in src.glob('*'): empty = False print(f"moving {file} to {dst}") - shutil.move(str(file), str(dst)) + # shutil.move(str(file), str(dst)) + file.rename(dst / file.name) # Overwrite files if empty: print(f"{src} is empty")