summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/keybase/go-keybase-chat-bot/kbchat
diff options
context:
space:
mode:
authorWim <wim@42.be>2021-12-12 00:05:15 +0100
committerGitHub <noreply@github.com>2021-12-12 00:05:15 +0100
commit3893a035be347a7687a41d2054dd1b274d3a0504 (patch)
treedfe4a3bf72a0a6356e51bd8fc2e88e9a26e52331 /vendor/github.com/keybase/go-keybase-chat-bot/kbchat
parent658bdd9faa835660ae407331732e9d93d8f6443b (diff)
downloadmatterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.tar.gz
matterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.tar.bz2
matterbridge-msglm-3893a035be347a7687a41d2054dd1b274d3a0504.zip
Update dependencies/vendor (#1659)
Diffstat (limited to 'vendor/github.com/keybase/go-keybase-chat-bot/kbchat')
-rw-r--r--vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go27
1 files changed, 17 insertions, 10 deletions
diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go
index 68c8ca70..886cfff2 100644
--- a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go
+++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/kbchat.go
@@ -9,6 +9,7 @@ import (
"io/ioutil"
"os"
"os/exec"
+ "runtime"
"sync"
"time"
@@ -207,7 +208,9 @@ func (a *API) getUsername(runOpts RunOptions) (username string, err error) {
if err != nil {
return "", err
}
- p.ExtraFiles = []*os.File{output.(*os.File)}
+ if runtime.GOOS != "windows" {
+ p.ExtraFiles = []*os.File{output.(*os.File)}
+ }
if err = p.Start(); err != nil {
return "", err
}
@@ -282,7 +285,7 @@ func (a *API) startPipes() (err error) {
defer a.Unlock()
if a.apiCmd != nil {
if err := a.apiCmd.Process.Kill(); err != nil {
- return err
+ return fmt.Errorf("unable to kill previous API command %v", err)
}
}
a.apiCmd = nil
@@ -290,30 +293,32 @@ func (a *API) startPipes() (err error) {
if a.runOpts.StartService {
args := []string{fmt.Sprintf("-enable-bot-lite-mode=%v", a.runOpts.DisableBotLiteMode), "service"}
if err := a.runOpts.Command(args...).Start(); err != nil {
- return err
+ return fmt.Errorf("unable to start service %v", err)
}
}
if a.username, err = a.auth(); err != nil {
- return err
+ return fmt.Errorf("unable to auth: %v", err)
}
cmd := a.runOpts.Command("chat", "notification-settings", fmt.Sprintf("-disable-typing=%v", !a.runOpts.EnableTyping))
if err = cmd.Run(); err != nil {
- return err
+ return fmt.Errorf("unable to set notifiation settings %v", err)
}
a.apiCmd = a.runOpts.Command("chat", "api")
if a.apiInput, err = a.apiCmd.StdinPipe(); err != nil {
- return err
+ return fmt.Errorf("unable to get api stdin: %v", err)
}
output, err := a.apiCmd.StdoutPipe()
if err != nil {
- return err
+ return fmt.Errorf("unabel to get api stdout: %v", err)
+ }
+ if runtime.GOOS != "windows" {
+ a.apiCmd.ExtraFiles = []*os.File{output.(*os.File)}
}
- a.apiCmd.ExtraFiles = []*os.File{output.(*os.File)}
if err := a.apiCmd.Start(); err != nil {
- return err
+ return fmt.Errorf("unable to run chat api cmd: %v", err)
}
a.apiOutput = bufio.NewReader(output)
return nil
@@ -508,7 +513,9 @@ func (a *API) Listen(opts ListenOptions) (*Subscription, error) {
time.Sleep(pause)
continue
}
- p.ExtraFiles = []*os.File{stderr.(*os.File), output.(*os.File)}
+ if runtime.GOOS != "windows" {
+ p.ExtraFiles = []*os.File{stderr.(*os.File), output.(*os.File)}
+ }
boutput := bufio.NewScanner(output)
if err := p.Start(); err != nil {