Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .ci/magician/cmd/generate_downstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ func runMake(downstreamRepo *source.Repo, command string, rnr ExecRunner) error
return err
}
// -------------------------------------------------------------------
if _, err := rnr.Run("make", []string{"provider", "OUTPUT_PATH=" + downstreamRepo.Path, fmt.Sprintf("VERSION=%s", downstreamRepo.Version)}, nil); err != nil {
out, err := rnr.Run("make", []string{"provider", "OUTPUT_PATH=" + downstreamRepo.Path, fmt.Sprintf("VERSION=%s", downstreamRepo.Version)}, nil)
fmt.Println(out)
if err != nil {
return err
}
}
Expand Down
6 changes: 5 additions & 1 deletion .ci/magician/exec/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
package exec

import (
"bytes"
"container/list"
"errors"
"fmt"
"io"
"io/fs"
"log"
"os"
Expand Down Expand Up @@ -123,10 +125,12 @@ func (ar *Runner) Run(name string, args []string, env map[string]string) (string
for ev, val := range env {
cmd.Env = append(cmd.Env, fmt.Sprintf("%s=%s", ev, val))
}
var stderrBuf bytes.Buffer
cmd.Stderr = io.MultiWriter(os.Stderr, &stderrBuf)
out, err := cmd.Output()
switch typedErr := err.(type) {
case *exec.ExitError:
return string(out), fmt.Errorf("error running %s: %v\nstdout:\n%sstderr:\n%s", name, err, out, typedErr.Stderr)
return string(out), fmt.Errorf("error running %s: %v\nstdout:\n%sstderr:\n%s", name, err, out, stderrBuf.String())
case *fs.PathError:
return "", fmt.Errorf("path error running %s: %v", name, typedErr)

Expand Down
Loading