From 3bbab430bcdb033d5f6460b8f5580c9927372b98 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Fri, 13 Aug 2021 15:22:07 -0700 Subject: [PATCH] Update builtin command to load target from project --- builtin/otherplugin/command.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/builtin/otherplugin/command.go b/builtin/otherplugin/command.go index 18922072d..62cc80d90 100644 --- a/builtin/otherplugin/command.go +++ b/builtin/otherplugin/command.go @@ -104,7 +104,7 @@ func (c *Command) ExecuteThing(trm terminal.UI, flags map[string]interface{}) in return 0 } -func (c *Command) ExecuteInfo(trm terminal.UI, p plugincore.Project, t plugincore.Target) int32 { +func (c *Command) ExecuteInfo(trm terminal.UI, p plugincore.Project) int32 { mn, _ := p.MachineNames() trm.Output("\nMachines in this project") trm.Output(strings.Join(mn[:], "\n")) @@ -133,6 +133,12 @@ func (c *Command) ExecuteInfo(trm terminal.UI, p plugincore.Project, t plugincor ptrm.Output("YAY! This is project specific output!") } + t, err := p.Target("one") + if err != nil { + trm.Output("Failed to load `one' target -- " + err.Error()) + return 1 + } + m, err := t.Specialize((*plugincore.Machine)(nil)) if err != nil { trm.Output("Failed to specialize to machine! -- " + err.Error())