Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions qmk_cli/script_qmk.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import milc

from . import __version__
from .helpers import find_qmk_firmware, is_qmk_firmware, find_qmk_userspace
from .helpers import find_qmk_firmware, is_qmk_firmware, find_qmk_userspace, is_qmk_userspace

milc.cli.milc_options(version=__version__)
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'
Expand Down Expand Up @@ -73,7 +73,10 @@ def main():
# Environment setup
qmk_userspace = find_qmk_userspace()
qmk_firmware = find_qmk_firmware()
os.environ['QMK_USERSPACE'] = str(qmk_userspace)
if is_qmk_userspace(qmk_userspace):
os.environ['QMK_USERSPACE'] = str(qmk_userspace)
elif 'QMK_USERSPACE' in os.environ: # Failed to find valid userspace, including what was in the environment if specified -- wipe any environment variable if present as it's clearly invalid.
os.environ.pop('QMK_USERSPACE')
os.environ['QMK_HOME'] = str(qmk_firmware)
os.environ['ORIG_CWD'] = os.getcwd()

Expand Down