Skip to content

Commit bf90175

Browse files
committed
tools/mpremote: Allow user configuration on win32 USERPROFILE.
1 parent b52fe52 commit bf90175

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

docs/reference/mpremote.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ Shortcuts can be defined using the macro system. Built-in shortcuts are::
222222
- ``bootloader``: make the device enter its bootloader
223223

224224
Any user configuration, including user-defined shortcuts, can be placed in the file
225-
``.config/mpremote/config.py``. For example:
225+
``.config/mpremote/config.py``(relative to the ``XDG_CONFIG_HOME``, ``HOME``, or ``USERPROFILE`` environment variable).
226+
For example:
226227

227228
.. code-block:: python3
228229

tools/mpremote/mpremote/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,12 @@ def load_user_config():
333333
config.commands = {}
334334

335335
# Get config file name.
336-
path = os.getenv("XDG_CONFIG_HOME")
336+
if os.name == "nt":
337+
path = os.getenv("USERPROFILE")
338+
if path is None:
339+
return config
340+
else:
341+
path = os.getenv("XDG_CONFIG_HOME")
337342
if path is None:
338343
path = os.getenv("HOME")
339344
if path is None:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy