From 7aaee629703aa79401dc8d8794c85cfe07aeb458 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 30 Apr 2020 12:05:20 +0200 Subject: [PATCH] command/build: don't reset error code in case an error hapened --- command/build.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/command/build.go b/command/build.go index 6765b3128..9017ae471 100644 --- a/command/build.go +++ b/command/build.go @@ -120,6 +120,8 @@ func (c *BuildCommand) GetBuildsFromHCL(path string) ([]packer.Build, int) { ret := 0 if diags.HasErrors() { ret = 1 + // TODO(azr): Should we stop here or partially build ? Other builds could be + // working; should this be an option ? } builds, diags := cfg.GetBuilds(c.CoreConfig.Only, c.CoreConfig.Except) @@ -135,7 +137,6 @@ func (c *BuildCommand) GetBuildsFromHCL(path string) ([]packer.Build, int) { c.Ui.Message(b.String()) } } - ret = 0 if diags.HasErrors() { ret = 1 }