doctor: support arm64 phones
parent
a9ef7d173f
commit
61330c60b5
|
@ -24,7 +24,13 @@ fn main(){
|
||||||
arch_details << cmd(command:'sysctl -n machdep.cpu.brand_string')
|
arch_details << cmd(command:'sysctl -n machdep.cpu.brand_string')
|
||||||
}
|
}
|
||||||
if os_kind == 'linux' {
|
if os_kind == 'linux' {
|
||||||
arch_details << cmd(command:'grep "model name" /proc/cpuinfo | sed "s/.*: //gm"')
|
mname := cmd(command:'grep "model name" /proc/cpuinfo | sed "s/.*: //gm"')
|
||||||
|
if !mname.starts_with('Error:') {
|
||||||
|
arch_details << mname
|
||||||
|
} else {
|
||||||
|
hinfo := cmd(command:'grep "Hardware" /proc/cpuinfo | sed "s/.*: //gm"')
|
||||||
|
arch_details << hinfo
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if os_kind == 'windows' {
|
if os_kind == 'windows' {
|
||||||
arch_details << cmd(command:'wmic cpu get name /format:table', line: 1)
|
arch_details << cmd(command:'wmic cpu get name /format:table', line: 1)
|
||||||
|
@ -83,7 +89,10 @@ fn cmd(c CmdConfig) string {
|
||||||
return 'N/A'
|
return 'N/A'
|
||||||
}
|
}
|
||||||
if x.exit_code == 0 {
|
if x.exit_code == 0 {
|
||||||
return x.output.split_into_lines()[c.line]
|
output := x.output.split_into_lines()
|
||||||
|
if output.len > 0 && output.len > c.line {
|
||||||
|
return output[c.line]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 'Error: $x.output'
|
return 'Error: $x.output'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue