vaguerent/builtin/myplugin/host/cap/write_hello.go
2022-04-25 12:24:10 -05:00

23 lines
504 B
Go

package cap
import (
"io/ioutil"
"github.com/hashicorp/vagrant-plugin-sdk/terminal"
)
func WriteHello(ui terminal.UI) error {
msg := "Hello from the write hello capability, compliments of the AlwaysTrue Host"
ui.Output(msg)
data := []byte(msg)
ioutil.WriteFile("/tmp/hello", data, 0644)
return nil
}
func WriteHelloNoUI() error {
msg := "Hello from the write hello capability, compliments of the AlwaysTrue Host"
data := []byte(msg)
ioutil.WriteFile("/tmp/hello", data, 0644)
return nil
}