mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
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:
parent
f947931af9
commit
42b0ba345f
@ -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)
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package git
|
||||
package main
|
||||
|
||||
import (
|
||||
"compress/zlib"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user