From da497dd04a20d6e73c622dc4bb4e36eeb0b6f5b9 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 13 Sep 2019 16:53:08 -0400 Subject: [PATCH] Add Exec() --- keybase.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/keybase.go b/keybase.go index c31fdb7..11b36bc 100644 --- a/keybase.go +++ b/keybase.go @@ -33,6 +33,15 @@ func NewKeybase(path ...string) *Keybase { return k } +// Exec executes the given Keybase command +func (k *Keybase) Exec(command ...string) ([]byte, error) { + out, err := exec.Command(k.Path, command...).Output() + if err != nil { + return []byte{}, err + } + return out, nil +} + // NewChat returns a new Chat instance func (k *Keybase) NewChat(channel Channel) Chat { return Chat{