From fd52320460fa4760ef26d2d798af0e9a687fbdcf Mon Sep 17 00:00:00 2001 From: Anthony Woods Date: Thu, 21 Jan 2016 11:39:51 +0800 Subject: [PATCH] set includedAppId of apiPlugins --- pkg/plugins/app_plugin.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/plugins/app_plugin.go b/pkg/plugins/app_plugin.go index 898065be8a2..d2291d487ac 100644 --- a/pkg/plugins/app_plugin.go +++ b/pkg/plugins/app_plugin.go @@ -59,6 +59,18 @@ func (app *AppPlugin) Load(decoder *json.Decoder, pluginDir string) error { } } + // check if we have child apiPlugins + for _, plugin := range ApiPlugins { + if strings.HasPrefix(plugin.PluginDir, app.PluginDir) { + plugin.IncludedInAppId = app.Id + app.Includes = append(app.Includes, AppIncludeInfo{ + Name: plugin.Name, + Id: plugin.Id, + Type: plugin.Type, + }) + } + } + Apps[app.Id] = app return nil }