pfetch: Simpler WSL2 detection.

This commit is contained in:
Dylan Araps 2019-10-01 00:49:54 +03:00
parent 146c6b6bae
commit 46b68022a3

9
pfetch
View File

@ -189,11 +189,10 @@ get_os() {
# WSL2 (Windows subsystem for Linux [version 2]) and # WSL2 (Windows subsystem for Linux [version 2]) and
# append a string accordingly. # append a string accordingly.
# #
# If either of these environment variables are defined # This checks to see if '$WSLENV' is defined. This
# and non-empty, we are very likely running under # appends the Windows 10 string even if '$WSLENV' is
# Windows 10 in WSL2. # empty. We only need to check that is has been _exported_.
[ "$WSL_INTEROP" ] || [ "$WSLENV" ] || [ "$WSL_DISTRO_NAME" ] && distro="${distro}${WSLENV+ on Windows 10 [WSL2]}"
distro="$distro on Windows 10 [WSL1]"
;; ;;
Darwin*) Darwin*)