aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/doctor.py
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2020-12-18 16:42:30 -0800
committerGitHub <noreply@github.com>2020-12-18 16:42:30 -0800
commitbded5f473c887fb36a2ca9d473635c1b84d0a04b (patch)
tree106cf4499145ccdbd434d5c1fbf8403f8fd9338f /lib/python/qmk/cli/doctor.py
parent6890090fbb929e0d1fe070b590dad2ee8a8eaa66 (diff)
downloadqmk_firmware-bded5f473c887fb36a2ca9d473635c1b84d0a04b.tar.gz
qmk_firmware-bded5f473c887fb36a2ca9d473635c1b84d0a04b.zip
simplify qmk doctor to make room for #11208 (#11242)
Diffstat (limited to 'lib/python/qmk/cli/doctor.py')
-rwxr-xr-xlib/python/qmk/cli/doctor.py30
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py
index 4fe318b63..25e2e239c 100755
--- a/lib/python/qmk/cli/doctor.py
+++ b/lib/python/qmk/cli/doctor.py
@@ -281,6 +281,22 @@ def is_executable(command):
281 return False 281 return False
282 282
283 283
284def os_tests():
285 """Determine our OS and run platform specific tests
286 """
287 platform_id = platform.platform().lower()
288
289 if 'darwin' in platform_id or 'macos' in platform_id:
290 return os_test_macos()
291 elif 'linux' in platform_id:
292 return os_test_linux()
293 elif 'windows' in platform_id:
294 return os_test_windows()
295 else:
296 cli.log.warning('Unsupported OS detected: %s', platform_id)
297 return CheckStatus.WARNING
298
299
284def os_test_linux(): 300def os_test_linux():
285 """Run the Linux specific tests. 301 """Run the Linux specific tests.
286 """ 302 """
@@ -317,20 +333,8 @@ def doctor(cli):
317 * [ ] Compile a trivial program with each compiler 333 * [ ] Compile a trivial program with each compiler
318 """ 334 """
319 cli.log.info('QMK Doctor is checking your environment.') 335 cli.log.info('QMK Doctor is checking your environment.')
320 status = CheckStatus.OK
321
322 # Determine our OS and run platform specific tests
323 platform_id = platform.platform().lower()
324 336
325 if 'darwin' in platform_id or 'macos' in platform_id: 337 status = os_tests()
326 status = os_test_macos()
327 elif 'linux' in platform_id:
328 status = os_test_linux()
329 elif 'windows' in platform_id:
330 status = os_test_windows()
331 else:
332 cli.log.warning('Unsupported OS detected: %s', platform_id)
333 status = CheckStatus.WARNING
334 338
335 cli.log.info('QMK home: {fg_cyan}%s', QMK_FIRMWARE) 339 cli.log.info('QMK home: {fg_cyan}%s', QMK_FIRMWARE)
336 340