mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 02:31:46 +00:00
ReadOutput for process, and --wait will read process output
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"time"
|
||||
@ -83,6 +84,14 @@ func Create(mode int, label string, execPath string, args []string, input string
|
||||
return proc, nil
|
||||
}
|
||||
|
||||
func ReadOutput(proc *Process) string {
|
||||
output, err := ioutil.ReadFile(proc.OutputPath)
|
||||
if err != nil {
|
||||
return fmt.Sprintf("ERROR READING OUTPUT: %v", err)
|
||||
}
|
||||
return string(output)
|
||||
}
|
||||
|
||||
func Stop(proc *Process, kill bool) error {
|
||||
defer proc.OutputFile.Close()
|
||||
if kill {
|
||||
|
Reference in New Issue
Block a user