Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Commit

Permalink
Prefer pinentry-mac on Darwin
Browse files Browse the repository at this point in the history
gpgconf isn't very reliable or useful.
  • Loading branch information
dominikschulz committed Dec 18, 2021
1 parent f73e4f2 commit 6c52bbc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pinentry_darwin.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
//go:build darwin
// +build darwin

package pinentry

import "github.com/gopasspw/pinentry/gpgconf"
import (
"os/exec"

"github.com/gopasspw/pinentry/gpgconf"
)

// GetBinary always returns pinentry-mac
func GetBinary() string {
// check, whether the returned path acutally exists
if _, err := exec.LookPath("pinentry-mac"); err == nil {
return "pinentry-mac"
}
if p, err := gpgconf.Path("pinentry"); err == nil && p != "" {
return p
}
Expand Down

0 comments on commit 6c52bbc

Please sign in to comment.