浏览代码

Update apt.go (#98)

Fix package check error when running ArozOS on mac m1.
bowwowxx 2 年之前
父节点
当前提交
23851a9278
共有 1 个文件被更改,包括 7 次插入7 次删除
  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 {
 				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" {
 		cmd := exec.Command("which", pkgname)
 		out, _ := cmd.CombinedOutput()