Fix pinentry
This commit is contained in:
parent
a41c91ca6b
commit
2651a36d3c
|
@ -1,16 +1,22 @@
|
||||||
//go:build freebsd || linux
|
//go:build freebsd || linux || darwin
|
||||||
|
|
||||||
package pinentry
|
package pinentry
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/twpayne/go-pinentry"
|
"github.com/twpayne/go-pinentry"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getPassword(title string, description string) (string, error) {
|
func getPassword(title string, description string) (string, error) {
|
||||||
|
binaryClientOption := pinentry.WithBinaryNameFromGnuPGAgentConf()
|
||||||
|
if runtime.GOOS == "darwin" {
|
||||||
|
binaryClientOption = pinentry.WithBinaryName("pinentry-mac")
|
||||||
|
}
|
||||||
|
|
||||||
client, err := pinentry.NewClient(
|
client, err := pinentry.NewClient(
|
||||||
pinentry.WithBinaryNameFromGnuPGAgentConf(),
|
binaryClientOption,
|
||||||
pinentry.WithGPGTTY(),
|
pinentry.WithGPGTTY(),
|
||||||
pinentry.WithTitle(title),
|
pinentry.WithTitle(title),
|
||||||
pinentry.WithDesc(description),
|
pinentry.WithDesc(description),
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
//go:build windows || darwin
|
//go:build windows
|
||||||
|
|
||||||
package pinentry
|
package pinentry
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue