Supress plugin discovery from plugins, which is redundant and noisy in the logs
This commit is contained in:
parent
ca3b4563e0
commit
3935703286
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -46,6 +47,12 @@ func decodeConfig(r io.Reader, c *config) error {
|
||||||
// Hence, the priority order is the reverse of the search order - i.e., the
|
// Hence, the priority order is the reverse of the search order - i.e., the
|
||||||
// CWD has the highest priority.
|
// CWD has the highest priority.
|
||||||
func (c *config) Discover() error {
|
func (c *config) Discover() error {
|
||||||
|
// If we are already inside a plugin process we should not need to
|
||||||
|
// discover anything.
|
||||||
|
if os.Getenv(plugin.MagicCookieKey) != "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// First, look in the same directory as the executable.
|
// First, look in the same directory as the executable.
|
||||||
exePath, err := osext.Executable()
|
exePath, err := osext.Executable()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue