cache_uname: change reading variables from 'SystemVersion.plist' as suggested in review
This commit is contained in:
parent
d0cd21c01e
commit
b7ffa9e9bf
1 changed files with 6 additions and 7 deletions
13
neofetch
13
neofetch
|
@ -4201,14 +4201,13 @@ cache_uname() {
|
||||||
if [[ "$kernel_name" == "Darwin" ]]; then
|
if [[ "$kernel_name" == "Darwin" ]]; then
|
||||||
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 in "${!sw_vers[@]}"; do
|
for ((i=0;i<${#sw_vers[@]};i+=2)) {
|
||||||
local value="${sw_vers[(( $i + 1 ))]}"
|
case ${sw_vers[i]} in
|
||||||
case "${sw_vers[$i]}" in
|
ProductName) darwin_name=${sw_vers[i+1]} ;;
|
||||||
"ProductName") darwin_name="$value" ;;
|
ProductVersion) osx_version=${sw_vers[i+1]} ;;
|
||||||
"ProductVersion") osx_version="$value" ;;
|
ProductBuildVersion) osx_build=${sw_vers[i+1]} ;;
|
||||||
"ProductBuildVersion") osx_build="$value" ;;
|
|
||||||
esac
|
esac
|
||||||
done
|
}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue