Fix error checking
This commit is contained in:
parent
d6e1cd2633
commit
91612b9d26
@ -112,10 +112,22 @@ func detectAndInstallBrowsers(startPath string) error {
|
|||||||
fmt.Printf("Found mozilla-like browser: %s\n", path)
|
fmt.Printf("Found mozilla-like browser: %s\n", path)
|
||||||
|
|
||||||
fmt.Println("Removing old manifest and proxy script")
|
fmt.Println("Removing old manifest and proxy script")
|
||||||
os.Chown(path+"/com.8bit.bitwarden.json", 7, 7)
|
err = os.Chown(path+"/com.8bit.bitwarden.json", 7, 7)
|
||||||
os.Remove(path + "/com.8bit.bitwarden.json")
|
if err != nil {
|
||||||
os.Chown(path+"/goldwarden-proxy.sh", 7, 7)
|
return err
|
||||||
os.Remove(path + "/goldwarden-proxy.sh")
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Println("Writing new manifest")
|
fmt.Println("Writing new manifest")
|
||||||
manifest := strings.Replace(templateMozilla, "PATH", path+"/goldwarden-proxy.sh", 1)
|
manifest := strings.Replace(templateMozilla, "PATH", path+"/goldwarden-proxy.sh", 1)
|
||||||
@ -133,10 +145,22 @@ func detectAndInstallBrowsers(startPath string) error {
|
|||||||
fmt.Printf("Found chrome-like browser: %s\n", path)
|
fmt.Printf("Found chrome-like browser: %s\n", path)
|
||||||
|
|
||||||
fmt.Println("Removing old manifest and proxy script")
|
fmt.Println("Removing old manifest and proxy script")
|
||||||
os.Chown(path+"/com.8bit.bitwarden.json", 7, 7)
|
err = os.Chown(path+"/com.8bit.bitwarden.json", 7, 7)
|
||||||
os.Remove(path + "/com.8bit.bitwarden.json")
|
if err != nil {
|
||||||
os.Chown(path+"/goldwarden-proxy.sh", 7, 7)
|
return err
|
||||||
os.Remove(path + "/goldwarden-proxy.sh")
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Println("Writing new manifest")
|
fmt.Println("Writing new manifest")
|
||||||
manifest := strings.Replace(templateChrome, "PATH", path+"/goldwarden-proxy.sh", 1)
|
manifest := strings.Replace(templateChrome, "PATH", path+"/goldwarden-proxy.sh", 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user