From de47ae56ff6fddc478bd1aed2e66a60f24d65865 Mon Sep 17 00:00:00 2001 From: nekohepott Date: Wed, 17 Jun 2026 04:16:25 +0300 Subject: [PATCH] more readable nixpkgs count check --- main.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 7a716fb..f84cc00 100644 --- a/main.go +++ b/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() + pkgs = strings.TrimSpace(string(out)) + " (pacman)" if haveNix { - pkgs = strings.TrimSpace(string(out)) + " (pacman), " + addNix() - } else { - pkgs = strings.TrimSpace(string(out)) + " (pacman)" + 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() + pkgs = strings.TrimSpace(string(out)) + " (apt)" if haveNix { - pkgs = strings.TrimSpace(string(out)) + " (apt), " + addNix() - } else { - pkgs = strings.TrimSpace(string(out)) + " (apt)" + pkgs = strings.TrimSpace(string(pkgs + ", " + addNix())) } return pkgs }