mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
stderr PR revisions
This commit is contained in:
parent
94c0172618
commit
0a3a08a3bc
@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## Develop-Branch changes (unreleased)
|
||||
|
||||
BREAKING CHANGES:
|
||||
|
||||
- [run] NewBaseService takes the new logger
|
||||
|
||||
## 0.2.1 (June 2, 2017)
|
||||
|
||||
FEATURES:
|
||||
|
@ -68,21 +68,18 @@ func RunCaptureWithArgs(cmd Executable, args []string, env map[string]string) (s
|
||||
}()
|
||||
|
||||
// copy the output in a separate goroutine so printing can't block indefinitely
|
||||
outC := make(chan string)
|
||||
go func() {
|
||||
var buf bytes.Buffer
|
||||
// io.Copy will end when we call wOut.Close() below
|
||||
io.Copy(&buf, rOut)
|
||||
outC <- buf.String()
|
||||
}()
|
||||
|
||||
errC := make(chan string)
|
||||
go func() {
|
||||
var buf bytes.Buffer
|
||||
// io.Copy will end when we call wErr.Close() below
|
||||
io.Copy(&buf, rErr)
|
||||
errC <- buf.String()
|
||||
}()
|
||||
copyStd := func(reader *os.File) *(chan string) {
|
||||
stdC := make(chan string)
|
||||
go func() {
|
||||
var buf bytes.Buffer
|
||||
// io.Copy will end when we call reader.Close() below
|
||||
io.Copy(&buf, *reader)
|
||||
stdC <- buf.String()
|
||||
}()
|
||||
return stdC
|
||||
}
|
||||
outC := copyStd(&rOut)
|
||||
errC := copyStd(&rErr)
|
||||
|
||||
// now run the command
|
||||
err = RunWithArgs(cmd, args, env)
|
||||
|
Loading…
x
Reference in New Issue
Block a user