|
|
@ -23,10 +23,7 @@ type Options struct { |
|
|
|
ChannelBufferSize int |
|
|
|
ChannelBufferSize int |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// locateKeybase attempts to find the location of the keybase binary in the following order:
|
|
|
|
// locateKeybase attempts to find the location of the keybase binary using the system PATH
|
|
|
|
// 1. What the user has specified as the location [user specified]
|
|
|
|
|
|
|
|
// 2. Looks up the binary location using exec.LookPath [default]
|
|
|
|
|
|
|
|
// 3. Returns "keybase" and hopes its pathed on the users system [fallback]
|
|
|
|
|
|
|
|
func locateKeybase() (string, error) { |
|
|
|
func locateKeybase() (string, error) { |
|
|
|
path, err := exec.LookPath("keybase") |
|
|
|
path, err := exec.LookPath("keybase") |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
@ -35,7 +32,7 @@ func locateKeybase() (string, error) { |
|
|
|
return path, nil |
|
|
|
return path, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// buildBaseCommand adds the homedirectory before the args, when required
|
|
|
|
// buildArgs adds the homedirectory before the args, when required
|
|
|
|
func buildArgs(opts Options, args ...string) ([]string, error) { |
|
|
|
func buildArgs(opts Options, args ...string) ([]string, error) { |
|
|
|
if len(args) == 0 { |
|
|
|
if len(args) == 0 { |
|
|
|
return nil, fmt.Errorf("no arguments") |
|
|
|
return nil, fmt.Errorf("no arguments") |
|
|
|