Преглед на файлове

CLI: Fix 'cd' subcommand on Windows (#16610)

The 'cd' subcommand was failing as the current shell's Windows path was
mangled while milc processed it.
Using 'subprocess' directly avoids this issue and an extra layer of
subshell.
Erovia преди 3 години
родител
ревизия
b75f6691a1
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      lib/python/qmk/cli/cd.py

+ 2 - 1
lib/python/qmk/cli/cd.py

@@ -2,6 +2,7 @@
 """
 import sys
 import os
+import subprocess
 
 from milc import cli
 
@@ -41,6 +42,6 @@ def cd(cli):
             # Set the prompt for the new shell
             qmk_env['MSYS2_PS1'] = qmk_env['PS1']
             # Start the new subshell
-            cli.run([os.environ.get('SHELL', '/usr/bin/bash')], env=qmk_env)
+            subprocess.run([os.environ.get('SHELL', '/usr/bin/bash')], env=qmk_env)
     else:
         cli.log.info("Already within qmk_firmware directory.")