diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2021-09-04 20:15:27 +0300 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2021-09-04 20:15:27 +0300 |
| commit | 9c1036b0b66e07610ddaa2e4154aecdd1111289c (patch) | |
| tree | 7e157f457d4b389506d4d893b135f08d37470801 | |
| parent | 13fd601d0bbd31fd75ec1667d83716a97b28283d (diff) | |
| download | pfetch-9c1036b0b66e07610ddaa2e4154aecdd1111289c.tar.gz | |
fix guix issue. closes #138, #144
| -rwxr-xr-x | pfetch | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -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. |
