|
|
|
|
@ -123,7 +123,23 @@ func (c *config) Discover() error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// First, look in the same directory as the executable.
|
|
|
|
|
// First, check whether there is a custom Plugin directory defined. This gets
|
|
|
|
|
// absolute preference.
|
|
|
|
|
if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" {
|
|
|
|
|
sep := ":"
|
|
|
|
|
if runtime.GOOS == "windows" {
|
|
|
|
|
// on windows, PATH is semicolon-separated
|
|
|
|
|
sep = ";"
|
|
|
|
|
}
|
|
|
|
|
plugPaths := strings.Split(packerPluginPath, sep)
|
|
|
|
|
for _, plugPath := range plugPaths {
|
|
|
|
|
if err := c.discoverExternalComponents(plugPath); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Next, look in the same directory as the executable.
|
|
|
|
|
exePath, err := osext.Executable()
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Printf("[ERR] Error loading exe directory: %s", err)
|
|
|
|
|
@ -133,7 +149,7 @@ func (c *config) Discover() error {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Next, look in the plugins directory.
|
|
|
|
|
// Next, look in the default plugins directory inside the configdir/.packer.d/plugins.
|
|
|
|
|
dir, err := packer.ConfigDir()
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Printf("[ERR] Error loading config directory: %s", err)
|
|
|
|
|
|