diff --git a/plugin.go b/plugin.go index bb643bb..70e53da 100644 --- a/plugin.go +++ b/plugin.go @@ -39,7 +39,7 @@ func pkValidate(config Config) *exec.Cmd { } for _, v := range config.VarFiles { - args = append(args, "-var-file", fmt.Sprintf("%s", v)) + args = append(args, fmt.Sprintf("-var-file=%s", v)) } for k, v := range config.Vars { @@ -72,7 +72,7 @@ func pkBuild(config Config) *exec.Cmd { } for _, v := range config.VarFiles { - args = append(args, "-var-file", fmt.Sprintf("%s", v)) + args = append(args, fmt.Sprintf("-var-file=%s", v)) } for k, v := range config.Vars { diff --git a/plugin_test.go b/plugin_test.go index 4a6b535..913d603 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -35,7 +35,7 @@ func Test_pkValidate(t *testing.T) { VarFiles: []string{"bar.json"}, }, }, - want: exec.Command("packer", "validate", "-var-file", "bar.json", "-var", "foo=bar", "foo.json"), + want: exec.Command("packer", "validate", "-var-file=bar.json", "-var", "foo=bar", "foo.json"), }, { name: "add except only color flag", @@ -89,7 +89,7 @@ func Test_pkBuild(t *testing.T) { VarFiles: []string{"bar.json"}, }, }, - want: exec.Command("packer", "build", "-var-file", "bar.json", "-var", "foo=bar", "foo.json"), + want: exec.Command("packer", "build", "-var-file=bar.json", "-var", "foo=bar", "foo.json"), }, { name: "add Parallel, Color and debug flag",