mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(cli): download all plugin dependencies
This commit is contained in:
parent
fc67ab1dce
commit
3c966caa23
@ -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"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user