Skip to content

Commit

Permalink
Merge pull request #176 from quexten/fix/browser-biometric-setup
Browse files Browse the repository at this point in the history
Fix browser biometric setup
  • Loading branch information
quexten authored Apr 28, 2024
2 parents 3ee8c72 + 35a3307 commit 7265154
Showing 1 changed file with 38 additions and 28 deletions.
66 changes: 38 additions & 28 deletions browserbiometrics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,26 @@ func detectAndInstallBrowsers(startPath string) error {
fmt.Printf("Found mozilla-like browser: %s\n", path)

fmt.Println("Removing old manifest and proxy script")
err = os.Chown(path+"/com.8bit.bitwarden.json", 7, 7)
if err != nil {
return err
}
err = os.Remove(path + "/com.8bit.bitwarden.json")
if err != nil {
return err
if _, err := os.Stat(path + "/com.8bit.bitwarden.json"); err == nil {
err = os.Chmod(path+"/com.8bit.bitwarden.json", 755)
if err != nil {
return err
}
err = os.Remove(path + "/com.8bit.bitwarden.json")
if err != nil {
return err
}
}
err = os.Chown(path+"/goldwarden-proxy.sh", 7, 7)
if err != nil {
return err
}
err = os.Remove(path + "/goldwarden-proxy.sh")
if err != nil {
return err

if _, err := os.Stat(path + "/goldwarden-proxy.sh"); err == nil {
err = os.Chmod(path+"/goldwarden-proxy.sh", 755)
if err != nil {
return err
}
err = os.Remove(path + "/goldwarden-proxy.sh")
if err != nil {
return err
}
}

fmt.Println("Writing new manifest")
Expand All @@ -159,21 +164,26 @@ func detectAndInstallBrowsers(startPath string) error {
fmt.Printf("Found chrome-like browser: %s\n", path)

fmt.Println("Removing old manifest and proxy script")
err = os.Chown(path+"/com.8bit.bitwarden.json", 7, 7)
if err != nil {
return err
}
err = os.Remove(path + "/com.8bit.bitwarden.json")
if err != nil {
return err
if _, err := os.Stat(path + "/com.8bit.bitwarden.json"); err == nil {
err = os.Chmod(path+"/com.8bit.bitwarden.json", 755)
if err != nil {
return err
}
err = os.Remove(path + "/com.8bit.bitwarden.json")
if err != nil {
return err
}
}
err = os.Chown(path+"/goldwarden-proxy.sh", 7, 7)
if err != nil {
return err
}
err = os.Remove(path + "/goldwarden-proxy.sh")
if err != nil {
return err

if _, err := os.Stat(path + "/goldwarden-proxy.sh"); err == nil {
err = os.Chmod(path+"/goldwarden-proxy.sh", 755)
if err != nil {
return err
}
err = os.Remove(path + "/goldwarden-proxy.sh")
if err != nil {
return err
}
}

fmt.Println("Writing new manifest")
Expand Down

0 comments on commit 7265154

Please sign in to comment.