Call capability func
This commit is contained in:
parent
c621b5f561
commit
9ebd62b37a
@ -2,11 +2,10 @@ package cap
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/hashicorp/vagrant-plugin-sdk/terminal"
|
||||
// "github.com/hashicorp/vagrant-plugin-sdk/terminal"
|
||||
)
|
||||
|
||||
func WriteHello(ui terminal.UI) error {
|
||||
func WriteHello() error {
|
||||
data := []byte("Hello from the write hello capability, compliments of the AlwaysTrue Host")
|
||||
ioutil.WriteFile("/tmp/hello", data, 0644)
|
||||
return nil
|
||||
|
||||
@ -162,7 +162,7 @@ func (c *Command) ExecuteUseHostPlugin(trm terminal.UI, host plugincore.Host) in
|
||||
ok := host.HasCapability("write_hello")
|
||||
if ok {
|
||||
trm.Output("Writing to file using `write_hello` capability")
|
||||
_, err := host.Capability("write_hello", argmapper.Typed("hehehe i'm a string"), argmapper.Typed(trm))
|
||||
_, err := host.Capability("write_hello", argmapper.Typed(trm))
|
||||
if err != nil {
|
||||
trm.Output("Error!")
|
||||
return 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user