From fc1956573ec9faa720fea74303b79613db8daa35 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 20 Sep 2020 15:10:35 +0300 Subject: [PATCH] doctor: try lsb_release on linux if it exists, fallback to os.uname if not --- cmd/tools/vdoctor.v | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/tools/vdoctor.v b/cmd/tools/vdoctor.v index 38285b9dcc..bbd508ccb4 100644 --- a/cmd/tools/vdoctor.v +++ b/cmd/tools/vdoctor.v @@ -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