MCPcopy
hub / github.com/ZToolsCenter/ZTools / killPluginAndReturn

Method killPluginAndReturn

src/main/api/renderer/plugins.ts:585–603  ·  view source on GitHub ↗
(pluginPath: string)

Source from the content-addressed store, hash-verified

583
584 // 终止插件并返回搜索页面
585 private killPluginAndReturn(pluginPath: string): { success: boolean; error?: string } {
586 try {
587 console.log('[Plugins] 终止插件并返回搜索页面:', pluginPath)
588 if (this.pluginManager) {
589 const result = this.pluginManager.killPlugin(pluginPath)
590 if (result) {
591 windowManager.notifyBackToSearch()
592 this.mainWindow?.webContents.focus()
593 return { success: true }
594 } else {
595 return { success: false, error: '插件未运行' }
596 }
597 }
598 return { success: false, error: '功能不可用' }
599 } catch (error: unknown) {
600 console.error('[Plugins] 终止插件并返回搜索页面失败:', error)
601 return { success: false, error: error instanceof Error ? error.message : '未知错误' }
602 }
603 }
604
605 // 获取插件 README.md 内容
606 public async getPluginReadme(

Callers 1

setupIPCMethod · 0.95

Calls 3

notifyBackToSearchMethod · 0.80
focusMethod · 0.80
killPluginMethod · 0.45

Tested by

no test coverage detected