From 6f55debc8a895cef92fc6324af9cd76ab43e0fb5 Mon Sep 17 00:00:00 2001 From: student_2333 Date: Mon, 4 Nov 2024 11:27:05 +0800 Subject: [PATCH] fix --- nonebot_plugin_nailongremove/model/update.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nonebot_plugin_nailongremove/model/update.py b/nonebot_plugin_nailongremove/model/update.py index 3374839..f22c257 100644 --- a/nonebot_plugin_nailongremove/model/update.py +++ b/nonebot_plugin_nailongremove/model/update.py @@ -115,6 +115,8 @@ class ModelUpdater(ABC): path = self.get_path(info.filename) if not (p := path.parent).exists(): p.mkdir(parents=True) + if path.exists(): + path.unlink() tmp_path.rename(path) def validate(self, path: Path, info: ModelInfo) -> Any: # noqa: ARG002