From 9c1036b0b66e07610ddaa2e4154aecdd1111289c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 4 Sep 2021 20:15:27 +0300 Subject: [PATCH] fix guix issue. closes #138, #144 --- pfetch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pfetch b/pfetch index cc8f341..5c697ea 100755 --- a/pfetch +++ b/pfetch @@ -238,7 +238,7 @@ get_os() { elif [ -d /system/app ] && [ -d /system/priv-app ]; then distro="Android $(getprop ro.build.version.release)" - else + elif [ -f /etc/os-release ]; then # This used to be a simple '. /etc/os-release' but I believe # this is insecure as we blindly executed whatever was in the # file. This parser instead simply handles 'key=val', treating @@ -250,6 +250,12 @@ get_os() { ;; esac done < /etc/os-release + + else + # Special cases for (independent) distributions which + # don't follow any os-release/lsb standards whatsoever. + has crux && distro=$(crux) + has guix && distro='Guix System' fi # 'os-release' and 'lsb_release' sometimes add quotes @@ -257,11 +263,6 @@ get_os() { distro=${distro##[\"\']} distro=${distro%%[\"\']} - # Special cases for (independent) distributions which - # don't follow any os-release/lsb standards whatsoever. - has crux && distro=$(crux) - has guix && distro='Guix System' - # Check to see if we're running Bedrock Linux which is # very unique. This simply checks to see if the user's # PATH contains a Bedrock specific value.