fix
This commit is contained in:
parent
5b9bd513a9
commit
c8ff986180
@ -23,16 +23,19 @@ func getPmPackages(packagerName string, packagerPath string) string {
|
|||||||
return strconv.Itoa(len(pkgs)-1) + " (pacman)"
|
return strconv.Itoa(len(pkgs)-1) + " (pacman)"
|
||||||
}
|
}
|
||||||
if packagerName == "apk" {
|
if packagerName == "apk" {
|
||||||
pkgs, err := exec.Command("apk", "info").Output() // i had to use this sorry
|
out, err := exec.Command("apk", "info").Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "error reading apk package list"
|
return "error reading apk package list"
|
||||||
}
|
}
|
||||||
pkgsRaw := strings.TrimSpace(string(pkgs))
|
pkgsRaw := strings.TrimSpace(string(out))
|
||||||
pkgsL := strings.Split(pkgsRaw, "\n")
|
|
||||||
pkgCount := len(pkgsL)
|
pkgsList := strings.Split(pkgsRaw, "\n")
|
||||||
|
pkgCount := len(pkgsList)
|
||||||
|
|
||||||
if pkgsRaw == "" {
|
if pkgsRaw == "" {
|
||||||
pkgCount = 0
|
pkgCount = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Sprintf("%d (apk)", pkgCount)
|
return fmt.Sprintf("%d (apk)", pkgCount)
|
||||||
}
|
}
|
||||||
return strconv.Itoa(len(pkgs)) + " (" + packagerName + ")"
|
return strconv.Itoa(len(pkgs)) + " (" + packagerName + ")"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user