Distro: Refactor $machine_arch
This commit is contained in:
parent
04bdb70227
commit
c0fb89ce40
11
neofetch
11
neofetch
|
@ -216,8 +216,14 @@ get_distro() {
|
||||||
[[ -z "$distro" ]] && distro="$os (Unknown)"
|
[[ -z "$distro" ]] && distro="$os (Unknown)"
|
||||||
|
|
||||||
# Get OS architecture.
|
# Get OS architecture.
|
||||||
[[ "$os_arch" == "on" ]] && \
|
if [[ "$os_arch" == "on" ]]; then
|
||||||
|
case "$os" in
|
||||||
|
"Solaris" | "AIX" | "BSD" | "macOS") machine_arch="$(uname -p)" ;;
|
||||||
|
*) machine_arch="$(uname -m)" ;;
|
||||||
|
|
||||||
|
esac
|
||||||
distro+=" ${machine_arch}"
|
distro+=" ${machine_arch}"
|
||||||
|
fi
|
||||||
|
|
||||||
[[ "${ascii_distro:-auto}" == "auto" ]] && \
|
[[ "${ascii_distro:-auto}" == "auto" ]] && \
|
||||||
ascii_distro="$(trim "$distro")"
|
ascii_distro="$(trim "$distro")"
|
||||||
|
@ -3772,11 +3778,10 @@ old_options() {
|
||||||
cache_uname() {
|
cache_uname() {
|
||||||
# Cache the output of uname so we don't
|
# Cache the output of uname so we don't
|
||||||
# have to spawn it multiple times.
|
# have to spawn it multiple times.
|
||||||
uname=($(uname -srm))
|
uname=($(uname -sr))
|
||||||
|
|
||||||
kernel_name="${uname[0]}"
|
kernel_name="${uname[0]}"
|
||||||
kernel_version="${uname[1]}"
|
kernel_version="${uname[1]}"
|
||||||
machine_arch="${uname[2]}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
convert_time() {
|
convert_time() {
|
||||||
|
|
Reference in New Issue