mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-04 21:06:03 +00:00
feat: 插件删除功能
This commit is contained in:
@@ -119,6 +119,7 @@ class GitHubRepoInstaller(installer.PluginInstaller):
|
||||
async def uninstall_plugin(
|
||||
self,
|
||||
plugin_name: str,
|
||||
task_context: taskmgr.TaskContext = taskmgr.TaskContext.placeholder(),
|
||||
):
|
||||
"""卸载插件
|
||||
"""
|
||||
@@ -127,7 +128,9 @@ class GitHubRepoInstaller(installer.PluginInstaller):
|
||||
if plugin_container is None:
|
||||
raise errors.PluginInstallerError('插件不存在或未成功加载')
|
||||
else:
|
||||
shutil.rmtree(plugin_container.pkg_path)
|
||||
task_context.trace("删除插件目录...", "uninstall-plugin")
|
||||
await aioshutil.rmtree(plugin_container.pkg_path)
|
||||
task_context.trace("完成, 重新加载以生效.", "uninstall-plugin")
|
||||
|
||||
async def update_plugin(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user