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