Specify which command to get command info from

This commit is contained in:
sophia 2021-04-21 16:30:39 -05:00 committed by Paul Hinze
parent 9f51d87038
commit 4dce4d148d
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
5 changed files with 4 additions and 5 deletions

View File

@ -42,7 +42,7 @@ func (c *Command) ExecuteFunc([]string) interface{} {
}
// CommandInfoFunc implements component.Command
func (c *Command) CommandInfoFunc() interface{} {
func (c *Command) CommandInfoFunc([]string) interface{} {
return c.CommandInfo
}

View File

@ -40,7 +40,7 @@ func (c *DoThing) ExecuteFunc([]string) interface{} {
}
// CommandInfoFunc implements component.Command
func (c *DoThing) CommandInfoFunc() interface{} {
func (c *DoThing) CommandInfoFunc([]string) interface{} {
return c.CommandInfo
}

View File

@ -42,7 +42,7 @@ func (c *Info) ExecuteFunc([]string) interface{} {
}
// CommandInfoFunc implements component.Command
func (c *Info) CommandInfoFunc() interface{} {
func (c *Info) CommandInfoFunc([]string) interface{} {
return c.CommandInfo
}

View File

@ -98,7 +98,7 @@ func (b *Basis) Init() (result *vagrant_server.Job_InitResult, err error) {
continue
}
b.logger.Trace("started a new plugin for init", "name", name)
cmdInfo, err := cmd.CommandInfo()
cmdInfo, err := cmd.CommandInfo([]string{name})
if err != nil {
b.logger.Error("failed to get command info for command "+name, "error", err)
}

View File

@ -200,7 +200,6 @@ func (p *Project) specializeComponent(c *Component) (cmp plugin.PluginMetadata,
func (p *Project) Run(ctx context.Context, task *vagrant_server.Task) (err error) {
p.logger.Debug("running new task", "project", p, "task", task)
// componentName := strings.Split(task.Component.Name, " ")[0]
cmd, err := p.basis.component(ctx, component.CommandType, task.Component.Name)
if err != nil {
return err