Skip to content

Commit e7f46eb

Browse files
committed
better diagnostics on custom exec error
Signed-off-by: Jordan Keister <[email protected]>
1 parent d5ef52d commit e7f46eb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

alpha/template/composite/builder.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ type ContainerConfig struct {
3434
}
3535

3636
type BuilderConfig struct {
37-
ContainerCfg ContainerConfig
38-
OutputType string
37+
ContainerCfg ContainerConfig
38+
OutputType string
3939
}
4040

4141
type Builder interface {
@@ -267,13 +267,12 @@ func (cb *CustomBuilder) Build(ctx context.Context, reg image.Registry, dir stri
267267
}
268268
// build the command to execute
269269
cmd := exec.Command(customConfig.Command, customConfig.Args...)
270-
cmd.Dir = cb.builderCfg.ContainerCfg.WorkingDir
271270

272271
// custom template should output a valid FBC to STDOUT so we can
273272
// build the FBC just like all the other templates.
274-
v, err := cmd.Output()
273+
v, err := cmd.CombinedOutput()
275274
if err != nil {
276-
return fmt.Errorf("running command %q: %v", cmd.String(), err)
275+
return fmt.Errorf("running command %q: %v: %v", cmd.String(), err, v)
277276
}
278277

279278
reader := bytes.NewReader(v)

0 commit comments

Comments
 (0)