fixup plugin loading

they have to be a main package

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent f947931a
......@@ -17,12 +17,14 @@ func init() {
func linxuLoadFunc(pluginDir string) ([]iplugin.Plugin, error) {
var plugins []iplugin.Plugin
filepath.Walk(pluginDir, func(fi string, info os.FileInfo, err error) error {
err := filepath.Walk(pluginDir, func(fi string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if info.IsDir() {
log.Warningf("found directory inside plugins directory: %s", fi)
if fi != pluginDir {
log.Warningf("found directory inside plugins directory: %s", fi)
}
return nil
}
......@@ -42,7 +44,7 @@ func linxuLoadFunc(pluginDir string) ([]iplugin.Plugin, error) {
return nil
})
return plugins, nil
return plugins, err
}
func loadPlugin(fi string) ([]iplugin.Plugin, error) {
......
......@@ -5,6 +5,7 @@ $(d)_plugins_so:=$(addsuffix .so,$($(d)_plugins))
$($(d)_plugins_so): $$(DEPS_GO) ALWAYS
go build -buildmode=plugin -i -pkgdir "$$GOPATH/pkg/linux_amd64_dynlink" $(go-flags-with-tags) -o "$@" "$(call go-pkg-name,$(basename $@))"
chmod +x "$@"
CLEAN += $($(d)_plugins_so)
......
package git
package main
import (
"compress/zlib"
......
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