From 9ebd62b37afb98b99466a4971f4f09773df94f32 Mon Sep 17 00:00:00 2001 From: sophia Date: Mon, 14 Jun 2021 13:05:17 -0500 Subject: [PATCH] Call capability func --- builtin/myplugin/host/cap/write_hello.go | 5 ++--- builtin/otherplugin/command.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/builtin/myplugin/host/cap/write_hello.go b/builtin/myplugin/host/cap/write_hello.go index a9d546944..e8ea434b3 100644 --- a/builtin/myplugin/host/cap/write_hello.go +++ b/builtin/myplugin/host/cap/write_hello.go @@ -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 diff --git a/builtin/otherplugin/command.go b/builtin/otherplugin/command.go index 394f2f199..467039138 100644 --- a/builtin/otherplugin/command.go +++ b/builtin/otherplugin/command.go @@ -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