Browse Source

neofetch: Only try pkg if on a BSD. Closes #1834

Dylan Araps 4 năm trước cách đây
mục cha
commit
017aa041d8
1 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 6 4
      neofetch

+ 6 - 4
neofetch

@@ -1608,13 +1608,15 @@ get_packages() {
             # TODO: Fix this somehow.
             has pkginfo && tot pkginfo -i
 
-            case $kernel_name in
-                FreeBSD|DragonFly) has pkg && tot pkg info ;;
+            case $os-$kernel_name in
+                BSD-FreeBSD|BSD-DragonFly)
+                    has pkg && tot pkg info
+                ;;
 
-                *)
+                BSD-*)
                     has pkg && dir /var/db/pkg/*
 
-                    ((packages == 0)) && \
+                    ((packages == 0)) &&
                         has pkg && tot pkg list
                 ;;
             esac