Commit 5bbe047e by bergquist

Revert "removes dependencies install for plugins"

This reverts commit 47e363ea.
parent 3b04efa4
......@@ -91,7 +91,14 @@ func InstallPlugin(pluginName, version string, c CommandLine) error {
}
logger.Infof("%s Installed %s successfully \n", color.GreenString("✔"), pluginName)
return nil
res, _ := s.ReadPlugin(pluginFolder, pluginName)
for _, v := range res.Dependencies.Plugins {
InstallPlugin(v.Id, version, c)
logger.Infof("Installed dependency: %v ✔\n", v.Id)
}
return err
}
func SelectVersion(plugin m.Plugin, version string) (m.Version, error) {
......
......@@ -14,7 +14,8 @@ type InstalledPlugin struct {
}
type Dependencies struct {
GrafanaVersion string `json:"grafanaVersion"`
GrafanaVersion string `json:"grafanaVersion"`
Plugins []Plugin `json:"plugins"`
}
type PluginInfo struct {
......
......@@ -59,6 +59,10 @@ func (pb *PluginBase) registerPlugin(pluginDir string) error {
plog.Info("Registering plugin", "name", pb.Name)
}
if len(pb.Dependencies.Plugins) == 0 {
pb.Dependencies.Plugins = []PluginDependencyItem{}
}
if pb.Dependencies.GrafanaVersion == "" {
pb.Dependencies.GrafanaVersion = "*"
}
......@@ -75,7 +79,8 @@ func (pb *PluginBase) registerPlugin(pluginDir string) error {
}
type PluginDependencies struct {
GrafanaVersion string `json:"grafanaVersion"`
GrafanaVersion string `json:"grafanaVersion"`
Plugins []PluginDependencyItem `json:"plugins"`
}
type PluginInclude struct {
......@@ -91,6 +96,13 @@ type PluginInclude struct {
Id string `json:"-"`
}
type PluginDependencyItem struct {
Type string `json:"type"`
Id string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
}
type PluginInfo struct {
Author PluginInfoLink `json:"author"`
Description string `json:"description"`
......
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