summaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/doctor.py
diff options
context:
space:
mode:
authorRoss Baquir <streakinthesky@gmail.com>2020-03-30 17:41:58 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commit3b2ecdedde9c2ce69eeacc215c08c509ed31ce5a (patch)
tree56e5e45bbe8662a936694ebc19b052fa6c3c8024 /lib/python/qmk/cli/doctor.py
parent0a76aa88b9ada3c3d9b8eb5b34c8bd697935cabc (diff)
Use version_arg in ESSENTIAL_BINARIES dict
Diffstat (limited to 'lib/python/qmk/cli/doctor.py')
-rwxr-xr-xlib/python/qmk/cli/doctor.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py
index 0023014554..7f0b52ffb6 100755
--- a/lib/python/qmk/cli/doctor.py
+++ b/lib/python/qmk/cli/doctor.py
@@ -16,8 +16,8 @@ ESSENTIAL_BINARIES = {
'dfu-programmer': {},
'avrdude': {},
'dfu-util': {},
- 'avr-gcc': {},
- 'arm-none-eabi-gcc': {},
+ 'avr-gcc': {'version_arg': '-dumpversion'},
+ 'arm-none-eabi-gcc': {'version_arg': '-dumpversion'},
'bin/qmk': {},
}
ESSENTIAL_SUBMODULES = ['lib/chibios', 'lib/lufa']
@@ -151,10 +151,8 @@ def is_executable(command):
return False
# Make sure the command can be executed
- check = subprocess.run([command, '-dumpversion'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, universal_newlines=True)
-
- if check.returncode > 1: # if -dumpversion returns error check with --version instead
- check = subprocess.run([command, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, universal_newlines=True)
+ version_arg = ESSENTIAL_BINARIES[command].get('version_arg', '--version')
+ check = subprocess.run([command, version_arg], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, universal_newlines=True)
ESSENTIAL_BINARIES[command]['output'] = check.stdout