2018-12-11 09:03:47 -05:00
|
|
|
package manager
|
|
|
|
|
2023-05-25 20:03:45 -04:00
|
|
|
import "os/exec"
|
2018-12-11 09:03:47 -05:00
|
|
|
|
|
|
|
// Candidate represents a possible plugin candidate, for mocking purposes
|
|
|
|
type Candidate interface {
|
|
|
|
Path() string
|
|
|
|
Metadata() ([]byte, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type candidate struct {
|
|
|
|
path string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *candidate) Path() string {
|
|
|
|
return c.path
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *candidate) Metadata() ([]byte, error) {
|
|
|
|
return exec.Command(c.path, MetadataSubcommandName).Output()
|
|
|
|
}
|