Update builtins to implement seed(s) function
This commit is contained in:
parent
678ffa60dc
commit
661785771f
@ -50,13 +50,18 @@ func (c *Host) Execute(trm terminal.UI, project core.Project) int32 {
|
||||
h, err := project.Host()
|
||||
if err != nil {
|
||||
trm.Output("ERROR: %s", err)
|
||||
return 1
|
||||
}
|
||||
|
||||
trm.Output("have host plugin to run against")
|
||||
|
||||
if r, err := h.HasCapability("dummy"); !r {
|
||||
trm.Output("No dummy capability found (%s)", err)
|
||||
return 1
|
||||
}
|
||||
|
||||
trm.Output("host plugin has dummy capability to run")
|
||||
|
||||
result, err := h.Capability("dummy", trm, "test value")
|
||||
if err != nil {
|
||||
trm.Output("Error running capability: %s", err)
|
||||
|
||||
@ -16,6 +16,14 @@ type AlwaysTrueHost struct {
|
||||
config HostConfig
|
||||
}
|
||||
|
||||
func (c *AlwaysTrueHost) Seed(args ...interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *AlwaysTrueHost) Seeds() ([]interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// DetectFunc implements component.Host
|
||||
func (h *AlwaysTrueHost) HostDetectFunc() interface{} {
|
||||
return h.Detect
|
||||
|
||||
@ -16,6 +16,14 @@ type AlwaysTrueGuest struct {
|
||||
config GuestConfig
|
||||
}
|
||||
|
||||
func (c *AlwaysTrueGuest) Seed(args ...interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *AlwaysTrueGuest) Seeds() ([]interface{}, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// DetectFunc implements component.Guest
|
||||
func (h *AlwaysTrueGuest) GuestDetectFunc() interface{} {
|
||||
return h.Detect
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user