(ctx context.Context, client sdkpluginstore.Client, manifest sdkpluginstore.Manifest, root string, platform Platform, pluginRuntime PluginRuntime)
| 191 | } |
| 192 | |
| 193 | func installManifest(ctx context.Context, client sdkpluginstore.Client, manifest sdkpluginstore.Manifest, root string, platform Platform, pluginRuntime PluginRuntime) (sdkpluginstore.InstallResult, error) { |
| 194 | id := strings.TrimSpace(manifest.ID) |
| 195 | if id == "" { |
| 196 | return sdkpluginstore.InstallResult{}, fmt.Errorf("home plugins: manifest plugin id is empty") |
| 197 | } |
| 198 | pluginIsBusy := func() bool { |
| 199 | return pluginRuntime != nil && pluginRuntime.PluginBusy(id) |
| 200 | } |
| 201 | result, errInstall := client.InstallManifest(ctx, manifest, sdkpluginstore.InstallOptions{ |
| 202 | PluginsDir: root, |
| 203 | GOOS: platform.GOOS, |
| 204 | GOARCH: platform.GOARCH, |
| 205 | PluginLoaded: pluginIsBusy, |
| 206 | }) |
| 207 | if errInstall != nil { |
| 208 | return sdkpluginstore.InstallResult{}, fmt.Errorf("home plugins: install %s: %w", id, errInstall) |
| 209 | } |
| 210 | return result, nil |
| 211 | } |
| 212 | |
| 213 | func DeleteWithReport(ctx context.Context, cfg *config.Config, pluginRuntime PluginRuntime, taskID uint, pluginID string) SyncReport { |
| 214 | _ = ctx |
no test coverage detected