doctor: try lsb_release on linux if it exists, fallback to os.uname if not

pull/6432/head
Delyan Angelov 2020-09-20 15:10:35 +03:00
parent b39b195043
commit fc1956573e
1 changed files with 6 additions and 1 deletions

View File

@ -32,7 +32,12 @@ fn main(){
//
mut os_details := ''
if os_kind == 'linux' {
os_details = cmd(command: 'lsb_release -d -s')
if os.is_file('/usr/bin/lsb_release') {
os_details = cmd(command: '/usr/bin/lsb_release -d -s')
} else {
ouname := os.uname()
os_details = '$ouname.release, $ouname.version'
}
}
if os_kind == 'mac' {
mut details := []string