Commit 726b835 1 parent d43cfd2 commit 726b835 Copy full SHA for 726b835
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ package toolchain
25
25
import (
26
26
"bufio"
27
27
"github.com/murex/tcr/report"
28
+ "io"
28
29
"os/exec"
29
30
)
30
31
@@ -83,9 +84,8 @@ func (r *CommandRunner) Run(cmd *Command) (result CommandResult) {
83
84
// Allow simultaneous trace and capture of command's stdout and stderr
84
85
outReader , _ := r .command .StdoutPipe ()
85
86
errReader , _ := r .command .StderrPipe ()
86
- doneOut , doneErr := make (chan bool ), make (chan bool )
87
- r .reportCommandTrace (bufio .NewScanner (outReader ), doneOut )
88
- r .reportCommandTrace (bufio .NewScanner (errReader ), doneErr )
87
+ r .reportCommandTrace (outReader )
88
+ r .reportCommandTrace (errReader )
89
89
90
90
// Start the command asynchronously
91
91
errStart := r .command .Start ()
@@ -113,11 +113,11 @@ func (r *CommandRunner) Run(cmd *Command) (result CommandResult) {
113
113
return result
114
114
}
115
115
116
- func (* CommandRunner ) reportCommandTrace (scanner * bufio.Scanner , done chan bool ) {
116
+ func (* CommandRunner ) reportCommandTrace (readCloser io.ReadCloser ) {
117
+ scanner := bufio .NewScanner (readCloser )
117
118
go func () {
118
119
for scanner .Scan () {
119
120
report .PostText (scanner .Text ())
120
121
}
121
- done <- true
122
122
}()
123
123
}
You can’t perform that action at this time.
0 commit comments