diff options
-rwxr-xr-x | lib/python/qmk/cli/doctor.py | 30 |
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 | ||
284 | def 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 | |||
284 | def os_test_linux(): | 300 | def 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 | ||