From c8120bc2eb3bf0b52233464e791e363232146c7e Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 13 Jun 2013 10:06:06 -0700 Subject: [PATCH] TODO in command/validate --- command/validate/commang.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/command/validate/commang.go b/command/validate/commang.go index 05bfb8e55..34544c954 100644 --- a/command/validate/commang.go +++ b/command/validate/commang.go @@ -63,15 +63,19 @@ func (c Command) Run(env packer.Environment, args []string) int { // Otherwise, get all the builds buildNames := tpl.BuildNames() - builds := make([]packer.Build, len(buildNames)) + builds := make([]packer.Build, 0, len(buildNames)) for i, buildName := range buildNames { - var err error - builds[i], err = tpl.Build(buildName, components) + build, err := tpl.Build(buildName, components) if err != nil { errs = append(errs, fmt.Errorf("Build '%s': %s", buildName, err)) + continue } + + builds = append(builds, build) } + // TODO(mitchellh): validate configuration + if len(errs) > 0 { err = &packer.MultiError{errs} env.Ui().Error(fmt.Sprintf("Template validation failed. %s", err))