mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-14 19:20:04 -04:00
packer: fix splitting error message on pathsep
This commit is contained in:
parent
ec92d231bc
commit
97db9d82c4
1 changed files with 4 additions and 2 deletions
|
|
@ -13,13 +13,15 @@ import (
|
|||
"github.com/hashicorp/packer-plugin-sdk/pathing"
|
||||
)
|
||||
|
||||
var pathSep = fmt.Sprintf("%c", os.PathListSeparator)
|
||||
|
||||
// PluginFolder returns the known plugin folder based on system.
|
||||
func PluginFolder() (string, error) {
|
||||
if packerPluginPath := os.Getenv("PACKER_PLUGIN_PATH"); packerPluginPath != "" {
|
||||
if strings.ContainsRune(packerPluginPath, os.PathListSeparator) {
|
||||
if strings.Contains(packerPluginPath, pathSep) {
|
||||
return "", fmt.Errorf("Multiple paths are no longer supported for PACKER_PLUGIN_PATH.\n"+
|
||||
"This should be defined as one of the following options for your environment:"+
|
||||
"\n* PACKER_PLUGIN_PATH=%v", strings.Join(strings.Split(packerPluginPath, ":"), "\n* PACKER_PLUGIN_PATH="))
|
||||
"\n* PACKER_PLUGIN_PATH=%v", strings.Join(strings.Split(packerPluginPath, pathSep), "\n* PACKER_PLUGIN_PATH="))
|
||||
}
|
||||
|
||||
return packerPluginPath, nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue