From fe5e6101e7d8357e0e6fa5a836f9a79ca77d1666 Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Thu, 28 Aug 2025 21:39:36 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=A2=9E=E5=BC=BA=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=AF=B9=E4=B8=8B=E8=BD=BD=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=EF=BC=8C=E7=A1=AE=E4=BF=9D?= =?UTF-8?q?=E5=9C=A8Git=E4=B8=8D=E5=8F=AF=E7=94=A8=E6=97=B6=E6=8A=9B?= =?UTF-8?q?=E5=87=BA=E7=9B=B8=E5=BA=94=E5=BC=82=E5=B8=B8=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E3=80=82=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E5=8D=87=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/builtin_plugins/plugin_store/data_source.py | 4 +++- zhenxun/utils/repo_utils/exceptions.py | 2 +- zhenxun/utils/repo_utils/file_manager.py | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zhenxun/builtin_plugins/plugin_store/data_source.py b/zhenxun/builtin_plugins/plugin_store/data_source.py index 6a90f70d..63dd50dc 100644 --- a/zhenxun/builtin_plugins/plugin_store/data_source.py +++ b/zhenxun/builtin_plugins/plugin_store/data_source.py @@ -279,13 +279,15 @@ class StoreManager: target_dir = BASE_PATH / "plugins" / plugin_name files = [file for file in files if not file.is_dir] download_files = [(file.path, local_path / file.path) for file in files] - await RepoFileManager.download_files( + result = await RepoFileManager.download_files( github_url, download_files, repo_type=repo_type, sparse_path=replace_module_path, target_dir=target_dir, ) + if not result.success: + raise PluginStoreException(result.error_message) requirement_paths = [ file diff --git a/zhenxun/utils/repo_utils/exceptions.py b/zhenxun/utils/repo_utils/exceptions.py index a640dbf3..a4049974 100644 --- a/zhenxun/utils/repo_utils/exceptions.py +++ b/zhenxun/utils/repo_utils/exceptions.py @@ -72,4 +72,4 @@ class GitUnavailableError(RepoManagerError): """Git不可用异常""" def __init__(self, message: str = "Git命令不可用"): - super().__init__(f"Git不可用: {message}") + super().__init__(message) diff --git a/zhenxun/utils/repo_utils/file_manager.py b/zhenxun/utils/repo_utils/file_manager.py index e95bdf2a..d45ef008 100644 --- a/zhenxun/utils/repo_utils/file_manager.py +++ b/zhenxun/utils/repo_utils/file_manager.py @@ -621,7 +621,10 @@ class RepoFileManager: except GitUnavailableError as e: logger.error(f"Git不可用: {e}") result.success = False - result.error_message = "Git不可用,请尝试添加参数 -s git" + result.error_message = ( + "当前插件包含二进制文件,因ali限制需要使用git," + "当前Git不可用,请尝试添加参数 -s git 或 安装 git" + ) return result except Exception as e: logger.error(f"sparse-checkout 克隆失败: {e}")