Merge pull request #8542 from TJM/plugin_logs
Parse out -PACKERSPACE- before looking for exec
This commit is contained in:
commit
d95b0122f8
16
config.go
16
config.go
|
@ -267,6 +267,14 @@ func (c *config) discoverInternalComponents() error {
|
||||||
func (c *config) pluginClient(path string) *plugin.Client {
|
func (c *config) pluginClient(path string) *plugin.Client {
|
||||||
originalPath := path
|
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.
|
// First attempt to find the executable by consulting the PATH.
|
||||||
path, err := exec.LookPath(path)
|
path, err := exec.LookPath(path)
|
||||||
if err != nil {
|
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
|
// If everything failed, just use the original path and let the error
|
||||||
// bubble through.
|
// bubble through.
|
||||||
if path == "" {
|
if path == "" {
|
||||||
|
|
Loading…
Reference in New Issue