소스 검색

qmk doctor: Display macOS and Windows versions, and add WSL warning for /mnt (#12441)

Ryan 4 년 전
부모
커밋
12f308748f
1개의 변경된 파일9개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      lib/python/qmk/cli/doctor.py

+ 9 - 4
lib/python/qmk/cli/doctor.py

@@ -35,6 +35,11 @@ def os_test_linux():
     if 'microsoft' in platform.uname().release.lower():
     if 'microsoft' in platform.uname().release.lower():
         cli.log.info("Detected {fg_cyan}Linux (WSL){fg_reset}.")
         cli.log.info("Detected {fg_cyan}Linux (WSL){fg_reset}.")
 
 
+        # https://github.com/microsoft/WSL/issues/4197
+        if QMK_FIRMWARE.startswith("/mnt"):
+            cli.log.warning("I/O performance on /mnt may be extremely slow.")
+            return CheckStatus.WARNING
+
         return CheckStatus.OK
         return CheckStatus.OK
     else:
     else:
         cli.log.info("Detected {fg_cyan}Linux{fg_reset}.")
         cli.log.info("Detected {fg_cyan}Linux{fg_reset}.")
@@ -46,7 +51,7 @@ def os_test_linux():
 def os_test_macos():
 def os_test_macos():
     """Run the Mac specific tests.
     """Run the Mac specific tests.
     """
     """
-    cli.log.info("Detected {fg_cyan}macOS{fg_reset}.")
+    cli.log.info("Detected {fg_cyan}macOS %s{fg_reset}.", platform.mac_ver()[0])
 
 
     return CheckStatus.OK
     return CheckStatus.OK
 
 
@@ -54,7 +59,8 @@ def os_test_macos():
 def os_test_windows():
 def os_test_windows():
     """Run the Windows specific tests.
     """Run the Windows specific tests.
     """
     """
-    cli.log.info("Detected {fg_cyan}Windows{fg_reset}.")
+    win32_ver = platform.win32_ver()
+    cli.log.info("Detected {fg_cyan}Windows %s (%s){fg_reset}.", win32_ver[0], win32_ver[1])
 
 
     return CheckStatus.OK
     return CheckStatus.OK
 
 
@@ -71,11 +77,10 @@ def doctor(cli):
         * [ ] Compile a trivial program with each compiler
         * [ ] Compile a trivial program with each compiler
     """
     """
     cli.log.info('QMK Doctor is checking your environment.')
     cli.log.info('QMK Doctor is checking your environment.')
+    cli.log.info('QMK home: {fg_cyan}%s', QMK_FIRMWARE)
 
 
     status = os_tests()
     status = os_tests()
 
 
-    cli.log.info('QMK home: {fg_cyan}%s', QMK_FIRMWARE)
-
     # Make sure our QMK home is a Git repo
     # Make sure our QMK home is a Git repo
     git_ok = check_git_repo()
     git_ok = check_git_repo()