Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

change the plugin path default from $PATH to $GOPATH/bin #896

Merged
merged 1 commit into from
Feb 1, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions plugins/plugins.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" {
Expand Down