Skip to content

Commit f93315a

Browse files
authored
[PR] #34 from saeziae: fix some problem in detecting cpu such as loongson
2 parents cde4914 + bce73f6 commit f93315a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: neofetch

+2-3
Original file line numberDiff line numberDiff line change
@@ -2579,9 +2579,8 @@ END
25792579
esac
25802580

25812581
# If cpu is not detected on a platform-specific bases, fallback to cpuinfo method
2582-
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' \
2583-
'/model name|Model|uarch|Hardware|Processor|^cpu model|chip type|^cpu type/ {
2584-
cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")"
2582+
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' '/model name|Model|uarch|Hardware|Processor|^cpu model|chip type|^cpu type/ { print $2; exit}' "$cpu_file")"
2583+
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' '/Hardware/ {print $2; exit}' "$cpu_file")"
25852584

25862585
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
25872586

0 commit comments

Comments
 (0)