fix macOS issue. See #1607

This commit is contained in:
Dylan Araps 2020-11-17 11:49:46 +02:00
parent 0c1a7996d3
commit 2a1788a11b
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 4 additions and 0 deletions

View File

@ -4774,6 +4774,10 @@ cache_uname() {
kernel_machine="${uname[2]}" kernel_machine="${uname[2]}"
if [[ "$kernel_name" == "Darwin" ]]; then if [[ "$kernel_name" == "Darwin" ]]; then
# macOS can report incorrect versions unless this is 0.
# https://github.com/dylanaraps/neofetch/issues/1607
export SYSTEM_VERSION_COMPAT=0
IFS=$'\n' read -d "" -ra sw_vers <<< "$(awk -F'<|>' '/key|string/ {print $3}' \ IFS=$'\n' read -d "" -ra sw_vers <<< "$(awk -F'<|>' '/key|string/ {print $3}' \
"/System/Library/CoreServices/SystemVersion.plist")" "/System/Library/CoreServices/SystemVersion.plist")"
for ((i=0;i<${#sw_vers[@]};i+=2)) { for ((i=0;i<${#sw_vers[@]};i+=2)) {