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}")