fixup plugin loading

they have to be a main package

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2017-07-12 23:39:23 +02:00
parent f947931af9
commit 42b0ba345f
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
3 changed files with 7 additions and 4 deletions

View File

@ -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) {

View File

@ -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)

View File

@ -1,4 +1,4 @@
package git
package main
import (
"compress/zlib"