@ -85,21 +85,28 @@ func (a *ChatAPI) _run(in, out chan string, e chan error) {
@@ -85,21 +85,28 @@ func (a *ChatAPI) _run(in, out chan string, e chan error) {
readCmd := a . opts . buildBaseCommand ( "chat" , "api-listen" )
writeCmd := a . opts . buildBaseCommand ( "chat" , "api" )
// set up the command
// set up the commands
cmd_reader := exec . CommandContext ( a . ctx , a . opts . locateKeybase ( ) , readCmd ... )
cmd_writer := exec . CommandContext ( a . ctx , a . opts . locateKeybase ( ) , writeCmd ... )
// grab the process stdin and stdout pipes
// grab the stdout pipe from the api-listen command
// it does not take stdin so only one pipe for this one
keyOut , err := cmd_reader . StdoutPipe ( )
if err != nil {
e <- err
return
}
// grab the stdin pipe for the writer
// this is to be able to send chat commands
keyIn , err := cmd_writer . StdinPipe ( )
if err != nil {
e <- err
return
}
// grab the stdout pipe from the writer
// for now we'll just JSON decode the rate limite responses
keyResp , err := cmd_writer . StdoutPipe ( )
if err != nil {
e <- err