From 793f9ae9e38f48720f637a54964357f762532bb0 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Thu, 3 Dec 2020 19:15:17 +0200 Subject: [PATCH] doctor: use os.uname().machine, on incomplete CPU info; display os.getwd() too --- cmd/tools/vdoctor.v | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/cmd/tools/vdoctor.v b/cmd/tools/vdoctor.v index fec3e80efe..1d7d3f0834 100644 --- a/cmd/tools/vdoctor.v +++ b/cmd/tools/vdoctor.v @@ -36,11 +36,17 @@ fn (mut a App) collect_info() { } if os_kind == 'linux' { info := a.cpu_info() - if info['model name'] != '' { - arch_details << info['model name'] - } else { - arch_details << info['hardware'] + mut cpu_details := '' + if cpu_details == '' { + cpu_details = info['model name'] } + if cpu_details == '' { + cpu_details = info['hardware'] + } + if cpu_details == '' { + cpu_details = os.uname().machine + } + arch_details << cpu_details } if os_kind == 'windows' { arch_details << a.cmd({ @@ -51,13 +57,13 @@ fn (mut a App) collect_info() { // mut os_details := '' wsl_check := a.cmd({ - command: 'cat /proc/sys/kernel/osrelease' - }) + command: 'cat /proc/sys/kernel/osrelease' + }) if os_kind == 'linux' { os_details = a.get_linux_os_name() info := a.cpu_info() if 'hypervisor' in info['flags'] { - if 'microsoft' in wsl_check { + if 'microsoft' in wsl_check { // WSL 2 is a Managed VM and Full Linux Kernel // See https://docs.microsoft.com/en-us/windows/wsl/compare-versions os_details += ' (WSL 2)' @@ -104,6 +110,7 @@ fn (mut a App) collect_info() { command: 'cc --version' })) a.println('') + a.line('getwd', os.getwd()) vexe := os.getenv('VEXE') vroot := os.dir(vexe) os.chdir(vroot)