From d024ca0b1ebcc6750aa93d6759f342db86b82e51 Mon Sep 17 00:00:00 2001 From: Mark Bates Date: Thu, 1 Feb 2018 12:16:32 -0500 Subject: [PATCH] change the plugin path default from $PATH to $GOPATH/bin --- plugins/plugins.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/plugins.go b/plugins/plugins.go index 08bb0b906..47aa5918a 100644 --- a/plugins/plugins.go +++ b/plugins/plugins.go @@ -20,7 +20,9 @@ import ( type List map[string]Commands // Available plugins for the `buffalo` command. -// It will look in $PATH and the `./plugins` directory. +// It will look in $GOPATH/bin and the `./plugins` directory. +// This can be changed by setting the $BUFFALO_PLUGIN_PATH +// environment variable. // // Requirements: // * file/command must be executable @@ -35,7 +37,11 @@ func Available() (List, error) { from, err := envy.MustGet("BUFFALO_PLUGIN_PATH") if err != nil { - from = envy.Get("PATH", "") + from, err = envy.MustGet("GOPATH") + if err != nil { + return list, errors.WithStack(err) + } + from = filepath.Join(from, "bin") } if runtime.GOOS == "windows" {