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()
|
haveNix := checkNix()
|
||||||
if strings.HasPrefix(dist, "Arch") {
|
if strings.HasPrefix(dist, "Arch") {
|
||||||
out, _ := exec.Command("sh", "-c", "pacman -Qq | wc -l").Output()
|
out, _ := exec.Command("sh", "-c", "pacman -Qq | wc -l").Output()
|
||||||
|
pkgs = strings.TrimSpace(string(out)) + " (pacman)"
|
||||||
if haveNix {
|
if haveNix {
|
||||||
pkgs = strings.TrimSpace(string(out)) + " (pacman), " + addNix()
|
pkgs = strings.TrimSpace(string(pkgs + ", " + addNix()))
|
||||||
} else {
|
|
||||||
pkgs = strings.TrimSpace(string(out)) + " (pacman)"
|
|
||||||
}
|
}
|
||||||
return pkgs
|
return pkgs
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(dist, "Debian") {
|
if strings.HasPrefix(dist, "Debian") {
|
||||||
out, _ := exec.Command("sh", "-c", "dpkg -l | grep ^ii | wc -l").Output()
|
out, _ := exec.Command("sh", "-c", "dpkg -l | grep ^ii | wc -l").Output()
|
||||||
|
pkgs = strings.TrimSpace(string(out)) + " (apt)"
|
||||||
if haveNix {
|
if haveNix {
|
||||||
pkgs = strings.TrimSpace(string(out)) + " (apt), " + addNix()
|
pkgs = strings.TrimSpace(string(pkgs + ", " + addNix()))
|
||||||
} else {
|
|
||||||
pkgs = strings.TrimSpace(string(out)) + " (apt)"
|
|
||||||
}
|
}
|
||||||
return pkgs
|
return pkgs
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user