Commit 3c966caa by bergquist

feat(cli): download all plugin dependencies

parent fc67ab1d
......@@ -14,6 +14,7 @@ import (
"strings"
"github.com/fatih/color"
"github.com/grafana/grafana-cli/pkg/log"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
m "github.com/grafana/grafana/pkg/cmd/grafana-cli/models"
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)
/* Enable once we need support for downloading depedencies
res, _ := s.ReadPlugin(pluginFolder, pluginName)
for _, v := range res.Dependency.Plugins {
for _, v := range res.Dependencies.Plugins {
InstallPlugin(v.Id, version, c)
log.Infof("Installed dependency: %v ✔\n", v.Id)
}
*/
return err
}
......
......@@ -9,11 +9,11 @@ type InstalledPlugin struct {
Name string `json:"name"`
Type string `json:"type"`
Info PluginInfo `json:"info"`
Dependency Dependency `json:"dependencies"`
Info PluginInfo `json:"info"`
Dependencies Dependencies `json:"dependencies"`
}
type Dependency struct {
type Dependencies struct {
GrafanaVersion string `json:"grafanaVersion"`
Plugins []Plugin `json:"plugins"`
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment