From 9d85aa36ec300d8215e177868fae40cd688827b2 Mon Sep 17 00:00:00 2001 From: Tommy McNeely Date: Fri, 27 Dec 2019 14:23:28 -0700 Subject: [PATCH] Parse out -PACKERSPACE- before looking for exec --- config.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config.go b/config.go index f99761979..44eebc3a2 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 == "" {