listremote_command.go 489 B

12345678910111213141516171819202122232425
  1. package commands
  2. import (
  3. "github.com/grafana/grafana/pkg/cmd/grafana-cli/log"
  4. s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
  5. )
  6. func listremoteCommand(c CommandLine) error {
  7. plugin, err := s.ListAllPlugins(c.GlobalString("repo"))
  8. if err != nil {
  9. return err
  10. }
  11. for _, i := range plugin.Plugins {
  12. pluginVersion := ""
  13. if len(i.Versions) > 0 {
  14. pluginVersion = i.Versions[0].Version
  15. }
  16. log.Infof("id: %v version: %s\n", i.Id, pluginVersion)
  17. }
  18. return nil
  19. }