You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
479 B

package process
import (
. "github.com/tendermint/tmlibs/common"
)
// Runs a command and gets the result.
func Run(dir string, command string, args []string) (string, bool, error) {
outFile := NewBufferCloser(nil)
proc, err := StartProcess("", dir, command, args, nil, outFile)
if err != nil {
return "", false, err
}
<-proc.WaitCh
if proc.ExitState.Success() {
return string(outFile.Bytes()), true, nil
} else {
return string(outFile.Bytes()), false, nil
}
}