Distribution path.
This commit is contained in:
parent
99f2b767be
commit
ad8c332b59
2 changed files with 14 additions and 11 deletions
|
|
@ -3,6 +3,8 @@
|
|||
We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup.
|
||||
"""
|
||||
import os
|
||||
import platform
|
||||
import platformdirs
|
||||
import shlex
|
||||
import sys
|
||||
from importlib.util import find_spec
|
||||
|
|
@ -13,7 +15,8 @@ from milc import cli, __VERSION__
|
|||
from milc.questions import yesno
|
||||
|
||||
# Ensure the QMK distribution is on the `$PATH` if present.
|
||||
QMK_DISTRIB_DIR = Path(os.environ.get('QMK_DISTRIB_DIR', os.path.expanduser('~/.local/qmk/distrib'))) # the expansion must be kept in sync with `util/env-bootstrap.sh`!
|
||||
_default_distrib_path = '/opt/qmk' if 'windows' in platform.platform().lower() else platformdirs.user_data_path('qmk') # this must be kept in sync with the default values inside `util/env-bootstrap.sh`!
|
||||
QMK_DISTRIB_DIR = Path(os.environ.get('QMK_DISTRIB_DIR', _default_distrib_path))
|
||||
if QMK_DISTRIB_DIR.exists():
|
||||
os.environ['PATH'] = str(QMK_DISTRIB_DIR / 'bin') + os.pathsep + os.environ['PATH']
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue