mirror of
https://github.com/openstenoproject/qmk
synced 2024-11-10 10:39:09 +00:00
When checking program returncodes treat both 0 and 1 as installed
This commit is contained in:
parent
5421ba11de
commit
d1b6c11b7f
1 changed files with 4 additions and 5 deletions
|
@ -24,8 +24,7 @@ def doctor(cli):
|
||||||
cli.log.info('QMK Doctor is checking your environment.')
|
cli.log.info('QMK Doctor is checking your environment.')
|
||||||
|
|
||||||
# Make sure the basic CLI tools we need are available and can be executed.
|
# Make sure the basic CLI tools we need are available and can be executed.
|
||||||
binaries = ['dfu-programmer', 'avrdude', 'dfu-util', 'avr-gcc', 'arm-none-eabi-gcc']
|
binaries = ['dfu-programmer', 'avrdude', 'dfu-util', 'avr-gcc', 'arm-none-eabi-gcc', 'bin/qmk']
|
||||||
binaries += glob('bin/qmk-*')
|
|
||||||
ok = True
|
ok = True
|
||||||
|
|
||||||
for binary in binaries:
|
for binary in binaries:
|
||||||
|
@ -34,10 +33,10 @@ def doctor(cli):
|
||||||
cli.log.error("{fg_red}QMK can't find %s in your path.", binary)
|
cli.log.error("{fg_red}QMK can't find %s in your path.", binary)
|
||||||
ok = False
|
ok = False
|
||||||
else:
|
else:
|
||||||
try:
|
check = subprocess.run([binary, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5)
|
||||||
subprocess.run([binary, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, check=True)
|
if check.returncode in [0, 1]:
|
||||||
cli.log.info('Found {fg_cyan}%s', binary)
|
cli.log.info('Found {fg_cyan}%s', binary)
|
||||||
except subprocess.CalledProcessError:
|
else:
|
||||||
cli.log.error("{fg_red}Can't run `%s --version`", binary)
|
cli.log.error("{fg_red}Can't run `%s --version`", binary)
|
||||||
ok = False
|
ok = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue