diff options
author | Ross Baquir <streakinthesky@gmail.com> | 2020-03-30 17:41:58 -0700 |
---|---|---|
committer | skullydazed <skullydazed@users.noreply.github.com> | 2020-04-04 12:43:13 -0700 |
commit | 70b501516258ae6b76d6a8b6cd86368ed4b63f11 (patch) | |
tree | c858292e3cdb9a0381e5026bfa828ecb67649182 /lib/python/qmk/cli/doctor.py | |
parent | 3fad3854d67e41464475e5551669a5c683d3c67d (diff) | |
download | qmk_firmware-70b501516258ae6b76d6a8b6cd86368ed4b63f11.tar.gz qmk_firmware-70b501516258ae6b76d6a8b6cd86368ed4b63f11.zip |
Use version_arg in ESSENTIAL_BINARIES dict
Diffstat (limited to 'lib/python/qmk/cli/doctor.py')
-rwxr-xr-x | lib/python/qmk/cli/doctor.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py index 002301455..7f0b52ffb 100755 --- a/lib/python/qmk/cli/doctor.py +++ b/lib/python/qmk/cli/doctor.py | |||
@@ -16,8 +16,8 @@ ESSENTIAL_BINARIES = { | |||
16 | 'dfu-programmer': {}, | 16 | 'dfu-programmer': {}, |
17 | 'avrdude': {}, | 17 | 'avrdude': {}, |
18 | 'dfu-util': {}, | 18 | 'dfu-util': {}, |
19 | 'avr-gcc': {}, | 19 | 'avr-gcc': {'version_arg': '-dumpversion'}, |
20 | 'arm-none-eabi-gcc': {}, | 20 | 'arm-none-eabi-gcc': {'version_arg': '-dumpversion'}, |
21 | 'bin/qmk': {}, | 21 | 'bin/qmk': {}, |
22 | } | 22 | } |
23 | ESSENTIAL_SUBMODULES = ['lib/chibios', 'lib/lufa'] | 23 | ESSENTIAL_SUBMODULES = ['lib/chibios', 'lib/lufa'] |
@@ -151,10 +151,8 @@ def is_executable(command): | |||
151 | return False | 151 | return False |
152 | 152 | ||
153 | # Make sure the command can be executed | 153 | # Make sure the command can be executed |
154 | check = subprocess.run([command, '-dumpversion'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, universal_newlines=True) | 154 | version_arg = ESSENTIAL_BINARIES[command].get('version_arg', '--version') |
155 | 155 | check = subprocess.run([command, version_arg], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, universal_newlines=True) | |
156 | if check.returncode > 1: # if -dumpversion returns error check with --version instead | ||
157 | check = subprocess.run([command, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, universal_newlines=True) | ||
158 | 156 | ||
159 | ESSENTIAL_BINARIES[command]['output'] = check.stdout | 157 | ESSENTIAL_BINARIES[command]['output'] = check.stdout |
160 | 158 | ||