Make the path assignment less confusing
This commit is contained in:
parent
3177a5413c
commit
72112ccae2
15
config.go
15
config.go
|
@ -132,10 +132,9 @@ func (c *config) discoverExternalComponents(path string) error {
|
|||
return err
|
||||
}
|
||||
for plugin, path := range pluginPaths {
|
||||
plugin := plugin
|
||||
path := path
|
||||
newPath := path // this needs to be stored in a new variable for the func below
|
||||
c.Builders[plugin] = func() (packer.Builder, error) {
|
||||
return c.pluginClient(path).Builder()
|
||||
return c.pluginClient(newPath).Builder()
|
||||
}
|
||||
externallyUsed = append(externallyUsed, plugin)
|
||||
}
|
||||
|
@ -150,10 +149,9 @@ func (c *config) discoverExternalComponents(path string) error {
|
|||
return err
|
||||
}
|
||||
for plugin, path := range pluginPaths {
|
||||
plugin := plugin
|
||||
path := path
|
||||
newPath := path // this needs to be stored in a new variable for the func below
|
||||
c.PostProcessors[plugin] = func() (packer.PostProcessor, error) {
|
||||
return c.pluginClient(path).PostProcessor()
|
||||
return c.pluginClient(newPath).PostProcessor()
|
||||
}
|
||||
externallyUsed = append(externallyUsed, plugin)
|
||||
}
|
||||
|
@ -168,10 +166,9 @@ func (c *config) discoverExternalComponents(path string) error {
|
|||
return err
|
||||
}
|
||||
for plugin, path := range pluginPaths {
|
||||
plugin := plugin
|
||||
path := path
|
||||
newPath := path // this needs to be stored in a new variable for the func below
|
||||
c.Provisioners[plugin] = func() (packer.Provisioner, error) {
|
||||
return c.pluginClient(path).Provisioner()
|
||||
return c.pluginClient(newPath).Provisioner()
|
||||
}
|
||||
externallyUsed = append(externallyUsed, plugin)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue