forked from toolshed/abra
cli
cmd
pkg
scripts
tests
vendor
coopcloud.tech
dario.cat
git.coopcloud.tech
github.com
AlecAivazis
Azure
BurntSushi
Microsoft
ProtonMail
aymanbagabas
beorn7
cenkalti
cespare
charmbracelet
cloudflare
containerd
containers
cpuguy83
cyphar
davecgh
decentral1se
distribution
docker
cli
cli
cli-plugins
hooks
manager
candidate.go
cobra.go
error.go
hooks.go
manager.go
manager_unix.go
manager_windows.go
metadata.go
plugin.go
suffix_unix.go
suffix_windows.go
opts
pkg
templates
AUTHORS
LICENSE
NOTICE
distribution
docker
docker-credential-helpers
go
go-connections
go-metrics
go-units
libtrust
emirpasic
felixge
fvbommel
ghodss
go-git
go-logfmt
go-logr
go-viper
gogo
golang
google
gorilla
grpc-ecosystem
hashicorp
inconshreveable
jbenet
kballard
kevinburke
klauspost
lucasb-eyer
mattn
mgutz
miekg
mitchellh
mmcloughlin
moby
morikuni
muesli
munnerz
opencontainers
pjbgf
pkg
pmezard
prometheus
rivo
russross
schollz
sergi
sirupsen
skeema
spf13
stretchr
theupdateframework
xanzy
xeipuuv
go.opentelemetry.io
golang.org
google.golang.org
gopkg.in
gotest.tools
modules.txt
.dockerignore
.drone.yml
.envrc.sample
.gitignore
.goreleaser.yml
AUTHORS.md
Dockerfile
LICENSE
Makefile
README.md
go.mod
go.sum
renovate.json
22 lines
484 B
Go
22 lines
484 B
Go
package manager
|
|
|
|
import "os/exec"
|
|
|
|
// 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() // #nosec G204 -- ignore "Subprocess launched with a potential tainted input or cmd arguments"
|
|
}
|