more readable nixpkgs count check
This commit is contained in:
parent
c712e8d295
commit
de47ae56ff
10
main.go
10
main.go
@ -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user