mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-08 18:12:37 +08:00
fix:插件恢复安全性
This commit is contained in:
@@ -143,8 +143,8 @@ def restore_plugins():
|
|||||||
for item in backup_dir.iterdir():
|
for item in backup_dir.iterdir():
|
||||||
target_path = plugins_dir / item.name
|
target_path = plugins_dir / item.name
|
||||||
|
|
||||||
# 如果是目录
|
# 如果是目录,且目录内有内容
|
||||||
if item.is_dir():
|
if item.is_dir() and any(item.iterdir()):
|
||||||
if target_path.exists():
|
if target_path.exists():
|
||||||
shutil.rmtree(target_path)
|
shutil.rmtree(target_path)
|
||||||
shutil.copytree(item, target_path)
|
shutil.copytree(item, target_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user