Update builtin command to load target from project
This commit is contained in:
parent
6e1dc229bb
commit
3bbab430bc
@ -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())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user