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
7 changes: 2 additions & 5 deletions saturn/pkg/run/java.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ func (s *JavaScaffold) Prepare() *Step {
}

log.Ctx(ctx).Debug().Msg("Updating distribution.")
out, err := s.Scaffold.RunCommand(
_, err := s.Scaffold.RunCommand(
ctx,
s.javaEnv,
"./gradlew",
"update",
fmt.Sprintf("-PonSaturn=%t", s.onSaturn),
)
log.Ctx(ctx).Debug().Msg(out)
if err != nil {
return fmt.Errorf("RunCommand: %v", err)
}
Expand Down Expand Up @@ -140,15 +139,14 @@ func (s *JavaScaffold) VerifySubmission() *Step {
"accepted": false,
})
}
out, err := s.Scaffold.RunCommand(
_, err := s.Scaffold.RunCommand(
ctx,
s.javaEnv,
"./gradlew",
"verify",
fmt.Sprintf("-Pteam=%s", pkg),
fmt.Sprintf("-PonSaturn=%t", s.onSaturn),
)
log.Ctx(ctx).Debug().Msg(out)
if err != nil {
arg.Finisher.Finish(saturn.TaskCompleted, map[string]interface{}{
"accepted": false,
Expand Down Expand Up @@ -193,7 +191,6 @@ func (s *JavaScaffold) RunMatch() *Step {
fmt.Sprintf("-PoutputVerbose=%t", false),
fmt.Sprintf("-PshowIndicators=%t", false),
)
log.Ctx(ctx).Debug().Msg(out)
if err != nil {
return fmt.Errorf("RunCommand: %v", err)
}
Expand Down
7 changes: 2 additions & 5 deletions saturn/pkg/run/python3.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ func (s *Python3Scaffold) Prepare() *Step {
}

log.Ctx(ctx).Debug().Msg("Updating distribution.")
out, err := s.Scaffold.RunCommand(
_, err := s.Scaffold.RunCommand(
ctx,
[]string{},
s.pyVersion,
"run.py",
"update",
fmt.Sprintf("--on-saturn=%t", s.onSaturn),
)
log.Ctx(ctx).Debug().Msg(out)
if err != nil {
return fmt.Errorf("RunCommand: %v", err)
}
Expand Down Expand Up @@ -126,7 +125,7 @@ func (s *Python3Scaffold) VerifySubmission() *Step {
"accepted": false,
})
}
out, err := s.Scaffold.RunCommand(
_, err := s.Scaffold.RunCommand(
ctx,
[]string{},
s.pyVersion,
Expand All @@ -135,7 +134,6 @@ func (s *Python3Scaffold) VerifySubmission() *Step {
fmt.Sprintf("--p1=%s", pkg),
fmt.Sprintf("--on-saturn=%t", s.onSaturn),
)
log.Ctx(ctx).Debug().Msg(out)
if err != nil {
arg.Finisher.Finish(saturn.TaskCompleted, map[string]interface{}{
"accepted": false,
Expand Down Expand Up @@ -181,7 +179,6 @@ func (s *Python3Scaffold) RunMatch() *Step {
fmt.Sprintf("--debug=%t", false),
fmt.Sprintf("--show-indicators=%t", false),
)
log.Ctx(ctx).Debug().Msg(out)
if err != nil {
return fmt.Errorf("RunCommand: %v", err)
}
Expand Down
4 changes: 3 additions & 1 deletion saturn/pkg/run/scaffold.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"errors"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -152,7 +153,8 @@ func (s *Scaffold) RunCommand(ctx context.Context, extra_env []string, name stri
procOutput := new(bytes.Buffer)
cmd := exec.CommandContext(ctx, name, arg...)
cmd.Dir = s.root
cmd.Stdout, cmd.Stderr = procOutput, procOutput
cmd.Stdout = io.MultiWriter(procOutput, log.Ctx(ctx))
cmd.Stderr = log.Ctx(ctx)
cmd.Env = os.Environ()
cmd.Env = append(cmd.Env, extra_env...)
err := cmd.Run()
Expand Down