Browse Source

Update apt.go (#98)

Fix package check error when running ArozOS on mac m1.
bowwowxx 2 years ago
parent
commit
23851a9278
1 changed files with 7 additions and 7 deletions
  1. 7 7
      src/mod/apt/apt.go

+ 7 - 7
src/mod/apt/apt.go

@@ -92,15 +92,15 @@ func PackageExists(pkgname string) (bool, error) {
 			if err != nil {
 			if err != nil {
 				return false, errors.New("Package " + pkgname + " not found in MacOS ENV variable.")
 				return false, errors.New("Package " + pkgname + " not found in MacOS ENV variable.")
 			}
 			}
+		}
+		if strings.TrimSpace(string(out)) != "" {
+			//Exists!
+			return true, nil
+		} else {
+			return false, errors.New("Package " + pkgname + " not installed on this Mac")
+		}
 
 
-			if strings.TrimSpace(string(out)) != "" {
-				//Exists!
-				return true, nil
-			} else {
-				return false, errors.New("Package " + pkgname + " not installed on this Mac")
-			}
 
 
-		}
 	} else if runtime.GOOS == "linux" {
 	} else if runtime.GOOS == "linux" {
 		cmd := exec.Command("which", pkgname)
 		cmd := exec.Command("which", pkgname)
 		out, _ := cmd.CombinedOutput()
 		out, _ := cmd.CombinedOutput()