Warn if fzf is not available when using --interactive

pull/6/head
Mickaël Menu 3 years ago
parent 0512bf78b4
commit 467acb3a08
No known key found for this signature in database
GPG Key ID: 53D73664CD359895

@ -77,7 +77,12 @@ func New(opts Opts) (*Fzf, error) {
args = append(args, "--preview", opts.PreviewCmd.String())
}
cmd := exec.Command("fzf", args...)
fzfPath, err := exec.LookPath("fzf")
if err != nil {
return nil, fmt.Errorf("interactive mode requires fzf, try without --interactive or install fzf from https://github.com/junegunn/fzf")
}
cmd := exec.Command(fzfPath, args...)
cmd.Stderr = os.Stderr
pipe, err := cmd.StdinPipe()

Loading…
Cancel
Save