pfetch: Fix WSL. Closes #57

This commit is contained in:
Dylan Araps 2020-05-29 09:58:05 +03:00
parent e74081fa46
commit 1713dc68a1
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

8
pfetch
View File

@ -195,8 +195,8 @@ get_os() {
#
# If the kernel version string ends in "-Microsoft",
# we're very likely running under Windows 10 in WSL1.
[ "${kernel%%*-Microsoft}" ] ||
distro="$distro on Windows 10 [WSL1]"
if [ "$WSLENV" ]; then
distro="${distro}${WSLENV+ on Windows 10 [WSL2]}"
# Check to see if Linux is running in Windows 10 under
# WSL2 (Windows subsystem for Linux [version 2]) and
@ -205,7 +205,9 @@ get_os() {
# This checks to see if '$WSLENV' is defined. This
# appends the Windows 10 string even if '$WSLENV' is
# empty. We only need to check that is has been _exported_.
distro="${distro}${WSLENV+ on Windows 10 [WSL2]}"
elif [ -z "${kernel%%*-Microsoft}" ]; then
distro="$distro on Windows 10 [WSL1]"
fi
;;
Darwin*)