feat(cli): download all plugin dependencies

This commit is contained in:
bergquist 2016-09-15 14:34:58 +02:00
parent fc67ab1dce
commit 3c966caa23
2 changed files with 6 additions and 6 deletions

View File

@ -14,6 +14,7 @@ import (
"strings" "strings"
"github.com/fatih/color" "github.com/fatih/color"
"github.com/grafana/grafana-cli/pkg/log"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/logger" "github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models" m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services" s "github.com/grafana/grafana/pkg/cmd/grafana-cli/services"
@ -90,13 +91,12 @@ func InstallPlugin(pluginName, version string, c CommandLine) error {
logger.Infof("%s Installed %s successfully \n", color.GreenString("✔"), plugin.Id) logger.Infof("%s Installed %s successfully \n", color.GreenString("✔"), plugin.Id)
/* Enable once we need support for downloading depedencies
res, _ := s.ReadPlugin(pluginFolder, pluginName) res, _ := s.ReadPlugin(pluginFolder, pluginName)
for _, v := range res.Dependency.Plugins { for _, v := range res.Dependencies.Plugins {
InstallPlugin(v.Id, version, c) InstallPlugin(v.Id, version, c)
log.Infof("Installed dependency: %v ✔\n", v.Id) log.Infof("Installed dependency: %v ✔\n", v.Id)
} }
*/
return err return err
} }

View File

@ -9,11 +9,11 @@ type InstalledPlugin struct {
Name string `json:"name"` Name string `json:"name"`
Type string `json:"type"` Type string `json:"type"`
Info PluginInfo `json:"info"` Info PluginInfo `json:"info"`
Dependency Dependency `json:"dependencies"` Dependencies Dependencies `json:"dependencies"`
} }
type Dependency struct { type Dependencies struct {
GrafanaVersion string `json:"grafanaVersion"` GrafanaVersion string `json:"grafanaVersion"`
Plugins []Plugin `json:"plugins"` Plugins []Plugin `json:"plugins"`
} }