more readable nixpkgs count check

This commit is contained in:
nekohepott 2026-06-17 04:16:25 +03:00
parent c712e8d295
commit de47ae56ff
No known key found for this signature in database

10
main.go
View File

@ -167,19 +167,17 @@ func getPkgs() string {
haveNix := checkNix()
if strings.HasPrefix(dist, "Arch") {
out, _ := exec.Command("sh", "-c", "pacman -Qq | wc -l").Output()
if haveNix {
pkgs = strings.TrimSpace(string(out)) + " (pacman), " + addNix()
} else {
pkgs = strings.TrimSpace(string(out)) + " (pacman)"
if haveNix {
pkgs = strings.TrimSpace(string(pkgs + ", " + addNix()))
}
return pkgs
}
if strings.HasPrefix(dist, "Debian") {
out, _ := exec.Command("sh", "-c", "dpkg -l | grep ^ii | wc -l").Output()
if haveNix {
pkgs = strings.TrimSpace(string(out)) + " (apt), " + addNix()
} else {
pkgs = strings.TrimSpace(string(out)) + " (apt)"
if haveNix {
pkgs = strings.TrimSpace(string(pkgs + ", " + addNix()))
}
return pkgs
}