provisioner/local-exec: Support custom environment variables on Windows

Due to an incorrect slice allocation, the environment variable list was created with an empty string
element for each real element added.

It appears that this was silently ignored on Unix, but caused the following environment settings
to be ignored altogether on Windows.
This commit is contained in:
Andre Bindewald 2018-06-16 03:26:43 +02:00 committed by Martin Atkins
parent ab6240afb0
commit de43f01d65
1 changed files with 0 additions and 1 deletions

View File

@ -60,7 +60,6 @@ func applyFn(ctx context.Context) error {
environment := data.Get("environment").(map[string]interface{}) environment := data.Get("environment").(map[string]interface{})
var env []string var env []string
env = make([]string, len(environment))
for k := range environment { for k := range environment {
entry := fmt.Sprintf("%s=%s", k, environment[k].(string)) entry := fmt.Sprintf("%s=%s", k, environment[k].(string))
env = append(env, entry) env = append(env, entry)