diff options
Diffstat (limited to 'lib/python/qmk/cli/doctor.py')
-rwxr-xr-x | lib/python/qmk/cli/doctor.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py index 309de0c671..2421e520e0 100755 --- a/lib/python/qmk/cli/doctor.py +++ b/lib/python/qmk/cli/doctor.py @@ -2,11 +2,9 @@ Check up for QMK environment. """ -import os import platform import shutil import subprocess -from glob import glob from milc import cli @@ -24,8 +22,7 @@ def doctor(cli): cli.log.info('QMK Doctor is checking your environment.') # 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 += glob('bin/qmk-*') + binaries = ['dfu-programmer', 'avrdude', 'dfu-util', 'avr-gcc', 'arm-none-eabi-gcc', 'bin/qmk'] ok = True for binary in binaries: @@ -34,15 +31,15 @@ def doctor(cli): cli.log.error("{fg_red}QMK can't find %s in your path.", binary) ok = False else: - try: - subprocess.run([binary, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5, check=True) + check = subprocess.run([binary, '--version'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=5) + if check.returncode in [0, 1]: cli.log.info('Found {fg_cyan}%s', binary) - except subprocess.CalledProcessError: + else: cli.log.error("{fg_red}Can't run `%s --version`", binary) ok = False # Determine our OS and run platform specific tests - OS = platform.system() + OS = platform.system() # noqa (N806), uppercase name is ok in this instance if OS == "Darwin": cli.log.info("Detected {fg_cyan}macOS.") |