diff --git a/tz_crypto_bt.py b/tz_crypto_bt.py index 3f299a0..524c2b3 100644 --- a/tz_crypto_bt.py +++ b/tz_crypto_bt.py @@ -49,7 +49,12 @@ for directory in directories_to_move: # 检查源目录是否存在 if os.path.isdir(source_path): # 使用shutil.move来移动目录 - shutil.move(source_path, target_path) + if os.path.exists(target_path): + if os.path.isdir(target_path): + shutil.rmtree(target_path) # 删除整个目录及其内容 + else: + os.remove(target_path) # 删除文件 + shutil.move(source_path, target_path) print(f"Moved {directory} to {target_path}") else: print(f"Directory {directory} does not exist in the current directory.")