fix guix issue. closes #138, #144

This commit is contained in:
Dylan Araps 2021-09-04 20:15:27 +03:00
parent 13fd601d0b
commit 9c1036b0b6
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C

13
pfetch
View File

@ -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.