Commit c8120bc2 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

TODO in command/validate

parent 0b896a0c
...@@ -63,15 +63,19 @@ func (c Command) Run(env packer.Environment, args []string) int { ...@@ -63,15 +63,19 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Otherwise, get all the builds // Otherwise, get all the builds
buildNames := tpl.BuildNames() buildNames := tpl.BuildNames()
builds := make([]packer.Build, len(buildNames)) builds := make([]packer.Build, 0, len(buildNames))
for i, buildName := range buildNames { for i, buildName := range buildNames {
var err error build, err := tpl.Build(buildName, components)
builds[i], err = tpl.Build(buildName, components)
if err != nil { if err != nil {
errs = append(errs, fmt.Errorf("Build '%s': %s", buildName, err)) errs = append(errs, fmt.Errorf("Build '%s': %s", buildName, err))
continue
} }
builds = append(builds, build)
} }
// TODO(mitchellh): validate configuration
if len(errs) > 0 { if len(errs) > 0 {
err = &packer.MultiError{errs} err = &packer.MultiError{errs}
env.Ui().Error(fmt.Sprintf("Template validation failed. %s", err)) env.Ui().Error(fmt.Sprintf("Template validation failed. %s", err))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment