diff --git a/config.go b/config.go index db2d73a95..6270f466b 100644 --- a/config.go +++ b/config.go @@ -267,6 +267,14 @@ func (c *config) discoverInternalComponents() error { func (c *config) pluginClient(path string) *plugin.Client { originalPath := path + // Check for special case using `packer plugin PLUGIN` + args := []string{} + if strings.Contains(path, PACKERSPACE) { + parts := strings.Split(path, PACKERSPACE) + path = parts[0] + args = parts[1:] + } + // First attempt to find the executable by consulting the PATH. path, err := exec.LookPath(path) if err != nil { @@ -282,14 +290,6 @@ func (c *config) pluginClient(path string) *plugin.Client { } } - // Check for special case using `packer plugin PLUGIN` - args := []string{} - if strings.Contains(path, PACKERSPACE) { - parts := strings.Split(path, PACKERSPACE) - path = parts[0] - args = parts[1:] - } - // If everything failed, just use the original path and let the error // bubble through. if path == "" {