Skip to content

Commit ea77338

Browse files
committed
Merge branch 'fix-output-channels'
2 parents e291897 + 9ae5e44 commit ea77338

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cmd/repeatr/run/runCmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func Run(stdout, stderr io.Writer) cli.ActionFunc {
102102
return nil
103103
}
104104
// Else: Okay, human/terminal mode it is!
105-
runRecord := terminal.Consume(runner, runID, stdout, stderr)
105+
runRecord := terminal.Consume(runner, runID, stderr)
106106

107107
// Raise the error that got in the way of execution, if any.
108108
cmdbhv.TryPlanToExit.MustHandle(runRecord.Failure)

cmd/repeatr/twerk/twerkCmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func Twerk(stdin io.Reader, stdout, stderr io.Writer) cli.ActionFunc {
9898
runID := runner.StartRun(&formula)
9999

100100
// Park our routine, following events and proxying them to terminal.
101-
runRecord := terminal.Consume(runner, runID, stdout, stderr)
101+
runRecord := terminal.Consume(runner, runID, stderr)
102102

103103
// Raise the error that got in the way of execution, if any.
104104
cmdbhv.TryPlanToExit.MustHandle(runRecord.Failure)

core/actors/terminal/terminal.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ import (
1313
"go.polydawn.net/repeatr/api/def"
1414
)
1515

16-
func Consume(observationPost act.RunObserver, runID def.RunID, stdout, stderr io.Writer) *def.RunRecord {
16+
func Consume(observationPost act.RunObserver, runID def.RunID, stderr io.Writer) *def.RunRecord {
1717
evtStream := make(chan *def.Event)
1818
go observationPost.FollowEvents(runID, evtStream, 0)
1919
for {
20-
if rr := step(evtStream, stdout, stderr); rr != nil {
20+
if rr := step(evtStream, stderr); rr != nil {
2121
return rr
2222
}
2323
}
2424
}
2525

26-
func step(evtStream chan *def.Event, stdout, stderr io.Writer) *def.RunRecord {
26+
func step(evtStream chan *def.Event, stderr io.Writer) *def.RunRecord {
2727
select {
2828
case evt := <-evtStream:
2929
if evt.Log != nil {
@@ -38,7 +38,7 @@ func step(evtStream chan *def.Event, stdout, stderr io.Writer) *def.RunRecord {
3838
}
3939
if evt.Journal != "" {
4040
// FIXME journal entries should just be byte slices
41-
stdout.Write([]byte(evt.Journal))
41+
stderr.Write([]byte(evt.Journal))
4242
return nil
4343
}
4444
if evt.RunRecord != nil {

0 commit comments

Comments
 (0)