diff --git a/zhenxun/builtin_plugins/__init__.py b/zhenxun/builtin_plugins/__init__.py index 825e23b1..4c993c2b 100644 --- a/zhenxun/builtin_plugins/__init__.py +++ b/zhenxun/builtin_plugins/__init__.py @@ -86,7 +86,7 @@ from bag_users t1 @PriorityLifecycle.on_startup(priority=5) async def _(): if not ZhenxunRepoManager.check_resources_exists(): - await ZhenxunRepoManager.resources_update(branch="test") + await ZhenxunRepoManager.resources_update() """签到与用户的数据迁移""" if goods_list := await GoodsInfo.filter(uuid__isnull=True).all(): for goods in goods_list: diff --git a/zhenxun/builtin_plugins/auto_update/__init__.py b/zhenxun/builtin_plugins/auto_update/__init__.py index 0595066c..32040400 100644 --- a/zhenxun/builtin_plugins/auto_update/__init__.py +++ b/zhenxun/builtin_plugins/auto_update/__init__.py @@ -100,7 +100,6 @@ async def _( source_str, # type: ignore zip.result, ) - await MessageUtils.build_message(result).finish(reply_to=True) except Exception as e: logger.error("版本更新失败...", "检查更新", session=session, e=e) await MessageUtils.build_message(f"更新版本失败...e: {e}").finish() diff --git a/zhenxun/utils/manager/zhenxun_repo_manager.py b/zhenxun/utils/manager/zhenxun_repo_manager.py index 046c0200..ecae4669 100644 --- a/zhenxun/utils/manager/zhenxun_repo_manager.py +++ b/zhenxun/utils/manager/zhenxun_repo_manager.py @@ -45,11 +45,11 @@ class ZhenxunRepoConfig: ZHENXUN_BOT_BACKUP_PATH = Path() / "backup" # 需要替换的文件夹 ZHENXUN_BOT_UPDATE_FOLDERS: ClassVar[list[str]] = [ - "builtin_plugins", - "services", - "utils", - "models", - "configs", + "zhenxun/builtin_plugins", + "zhenxun/services", + "zhenxun/utils", + "zhenxun/models", + "zhenxun/configs", ] ZHENXUN_BOT_VERSION_FILE_STRING = "__version__" ZHENXUN_BOT_VERSION_FILE = Path() / ZHENXUN_BOT_VERSION_FILE_STRING @@ -262,11 +262,10 @@ class ZhenxunRepoManagerClass: self.config.ZHENXUN_BOT_UNZIP_PATH / filename, Path() / filename, ) + logger.debug("备份真寻更新文件完成!", LOG_COMMAND) + unzip_dir = next(self.config.ZHENXUN_BOT_UNZIP_PATH.iterdir()) for folder in self.config.ZHENXUN_BOT_UPDATE_FOLDERS: - self.__copy_files( - self.config.ZHENXUN_BOT_UNZIP_PATH / folder, - self.config.ZHENXUN_BOT_CODE_PATH / folder, - ) + self.__copy_files(unzip_dir / folder, Path() / folder) logger.debug("移动真寻更新文件完成!", LOG_COMMAND) if self.config.ZHENXUN_BOT_UNZIP_PATH.exists(): shutil.rmtree(self.config.ZHENXUN_BOT_UNZIP_PATH)