Fix additional build errors

This commit is contained in:
Bernd Schoolmann 2023-09-12 03:26:05 +02:00
parent 257b911e00
commit 032da6cdf1
No known key found for this signature in database
4 changed files with 32 additions and 6 deletions

View File

@ -9,7 +9,7 @@ import (
func CheckBiometrics(approvalType Approval) bool {
ok, err := touchid.Authenticate(approvalType.String())
if err != nil {
log.Error(err)
log.Error(err.Error())
}
if ok {

View File

@ -0,0 +1,19 @@
//go:build linux
package setup
import (
"fmt"
"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/cmd"
)
func VerifySetup(runtimeConfig config.RuntimeConfig) bool {
if !cmd.IsPolkitSetup() && !runtimeConfig.DisableAuth {
fmt.Println("Polkit is not setup. Run 'goldwarden setup polkit' to set it up.")
return false
}
return true
}

View File

@ -0,0 +1,9 @@
//go:build !linux
package setup
import "github.com/quexten/goldwarden/agent/config"
func VerifySetup(runtimeConfig config.RuntimeConfig) bool {
return true
}

View File

@ -1,13 +1,12 @@
package main
import (
"fmt"
"os"
"strings"
"time"
"github.com/quexten/goldwarden/agent/config"
"github.com/quexten/goldwarden/browserbiometrics"
"github.com/quexten/goldwarden/client/setup"
"github.com/quexten/goldwarden/cmd"
)
@ -57,9 +56,8 @@ func main() {
os.Setenv("GOLDWARDEN_SYSTEM_AUTH_DISABLED", "true")
}
if !cmd.IsPolkitSetup() && !runtimeConfig.DisableAuth {
fmt.Println("Polkit is not setup. Run 'goldwarden setup polkit' to set it up.")
time.Sleep(3 * time.Second)
if !setup.VerifySetup(runtimeConfig) {
return
}
cmd.Execute(runtimeConfig)