Commit 739b699
Changed files (1)
src
others
src/others/version.py
@@ -119,6 +119,8 @@ async def update_bot(message: Message):
return
sync_dir(Path(root).joinpath("src"), "/app")
await modify_progress(status, text="✅升级成功\n重启Bot,请稍后...", force_update=True)
+ if Path(root).is_dir():
+ shutil.rmtree(root)
os._exit(0) # restarting is managed by s6-overlay
@@ -160,7 +162,6 @@ def sync_dir(src: str | Path, dst: str | Path):
if dst_file.is_file() and fname not in files and not fname.startswith(DOWNLOAD_DIR):
dst_file.unlink()
del_empty_dir(dst_root)
- shutil.rmtree(src_root)
def del_empty_dir(root: Path):