Skip to content

Commit

Permalink
CLI: Fix 'cd' subcommand on Windows (#16610)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Erovia authored Mar 10, 2022
1 parent 6c40b68 commit b75f669
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/python/qmk/cli/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""
import sys
import os
import subprocess

from milc import cli

Expand Down Expand Up @@ -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.")

0 comments on commit b75f669

Please sign in to comment.