Commit 58e52f35 authored by Steven Allen's avatar Steven Allen

feat: make it possible to enable plugins with a build env variable

parent 0ab1fa18
......@@ -127,6 +127,13 @@ To preload a go-ipfs plugin:
go-ipfs$ make build
```
You can also preload an in-tree but disabled-by-default plugin by adding it to
the IPFS_PLUGINS variable. For example, to enable plugins foo, bar, and baz:
```bash
go-ipfs$ make build IPFS_PLUGINS="foo bar baz"
```
## Creating A Plugin
To create your own out-of-tree plugin, use the [example
......
include mk/header.mk
IPFS_PLUGINS ?=
export IPFS_PLUGINS
$(d)/preload.go: d:=$(d)
$(d)/preload.go: $(d)/preload_list $(d)/preload.sh
$(d)/preload.go: $(d)/preload_list $(d)/preload.sh ALWAYS
$(d)/preload.sh > $@
go fmt $@ >/dev/null
......
......@@ -4,6 +4,11 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
to_preload() {
awk 'NF' "$DIR/preload_list" | sed '/^#/d'
if [[ -n "$IPFS_PLUGINS" ]]; then
for plugin in $IPFS_PLUGINS; do
echo "$plugin github.com/ipfs/go-ipfs/plugin/plugins/$plugin *"
done
fi
}
cat <<EOL
......
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