Skip to content

Commit

Permalink
Fix module name in go.mod to match the repository
Browse files Browse the repository at this point in the history
Small fixes to the errors printed from the `main` function and add a bit
of color with some emojis 🚀.
  • Loading branch information
jorgelbg committed Aug 31, 2021
1 parent 140ff7f commit 6662c46
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module github.com/jorgelbg/pinentry
module github.com/jorgelbg/pinentry-touchid

go 1.16

replace github.com/foxcpp/go-assuan => ./go-assuan

require (
github.com/enescakir/emoji v1.0.0 // indirect
github.com/foxcpp/go-assuan v1.0.0
github.com/gopasspw/pinentry v0.0.2
github.com/keybase/go-keychain v0.0.0-20201121013009-976c83ec27a6
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/enescakir/emoji v1.0.0 h1:W+HsNql8swfCQFtioDGDHCHri8nudlK1n5p2rHCJoog=
github.com/enescakir/emoji v1.0.0/go.mod h1:Bt1EKuLnKDTYpLALApstIkAjdDrS/8IAgTkKp+WKFD0=
github.com/gopasspw/pinentry v0.0.2 h1:6OmkoTYMU05PmAJSIZSRjjhiQX15AstdgNa2KimH5XA=
github.com/gopasspw/pinentry v0.0.2/go.mod h1:lR1WuNI96rXXBCgM601Ima3acnX3ZSPthIAuG6lHa68=
github.com/keybase/go-keychain v0.0.0-20201121013009-976c83ec27a6 h1:Mj0fhP9dzHKPijsmli/XbXMDKe1/KWy5xKci8e3nmBg=
Expand Down
13 changes: 7 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import (
"regexp"
"strings"

"github.com/enescakir/emoji"
"github.com/foxcpp/go-assuan/common"
"github.com/foxcpp/go-assuan/pinentry"
pinentryBinary "github.com/gopasspw/pinentry"
"github.com/jorgelbg/pinentry/sensor"
"github.com/jorgelbg/pinentry-touchid/sensor"
"github.com/keybase/go-keychain"
touchid "github.com/lox/go-touchid"
)
Expand Down Expand Up @@ -315,19 +316,19 @@ func GetPIN(authFn AuthFunc, promptFn PromptFunc, logger *log.Logger) GetPinFunc

func main() {
flag.Parse()

if !sensor.IsTouchIDAvailable() {
fmt.Fprintf(os.Stderr, "pinentry-touchid does not support devices without a Touch ID sensor!")
fmt.Fprintf(os.Stderr,
"%v pinentry-touchid does not support devices without a Touch ID sensor!\n", emoji.CrossMark)
os.Exit(-1)
}

if *check {
if _, err := exec.LookPath(pinentryBinary.GetBinary()); err != nil {
fmt.Fprintf(os.Stderr, "PIN entry program %q not found!", pinentryBinary.GetBinary())
fmt.Fprintf(os.Stderr, "PIN entry program %q not found!\n", pinentryBinary.GetBinary())
os.Exit(-1)
}

fmt.Printf("Looks good!")
fmt.Printf("%v Looks good!\n", emoji.CheckMarkButton)
os.Exit(0)
}

Expand All @@ -340,7 +341,7 @@ func main() {
}

if err := pinentry.Serve(callbacks, "Hi from pinentry-touchid!"); err != nil {
fmt.Fprintf(os.Stderr, "Pinentry Serve returned error: %v", err)
fmt.Fprintf(os.Stderr, "Pinentry Serve returned error: %v\n", err)
os.Exit(-1)
}
}

0 comments on commit 6662c46

Please sign in to comment.