Run executes the PluginList action
(_ context.Context)
| 86 | |
| 87 | // Run executes the PluginList action |
| 88 | func (action *PluginList) Run(_ context.Context) (*PluginListResult, error) { |
| 89 | action.cfg.Logger.Debug().Msg("Listing all plugins") |
| 90 | plugins := action.manager.GetAllPlugins() |
| 91 | |
| 92 | // Create a map of command names to plugin names |
| 93 | commandsMap := make(map[string]string) |
| 94 | for pluginName, plugin := range plugins { |
| 95 | for _, cmd := range plugin.Metadata.Commands { |
| 96 | commandsMap[cmd.Name] = pluginName |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | action.cfg.Logger.Debug().Int("pluginCount", len(plugins)).Int("commandCount", len(commandsMap)).Msg("Found plugins and commands") |
| 101 | return &PluginListResult{ |
| 102 | Plugins: plugins, |
| 103 | CommandsMap: commandsMap, |
| 104 | }, nil |
| 105 | } |
| 106 | |
| 107 | // NewPluginDescribe creates a new NewPluginDescribe action |
| 108 | func NewPluginDescribe(cfg *ActionsOpts, manager *plugins.Manager) *PluginDescribe { |
nothing calls this directly
no test coverage detected