]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
When checking program returncodes treat both 0 and 1 as installed
authorskullY <skullydazed@gmail.com>
Wed, 13 Nov 2019 01:21:33 +0000 (17:21 -0800)
committerskullydazed <skullydazed@users.noreply.github.com>
Wed, 13 Nov 2019 02:40:24 +0000 (18:40 -0800)
lib/python/qmk/cli/doctor.py

index 309de0c6712aa4d7b1d9004305ae938bcf25ff1b..c2723bfcbbdc0697dab4feb8aa821ec2971efba7 100755 (executable)
@@ -24,8 +24,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,10 +33,10 @@ 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