8000 mpremote: allow user configuration on Windows based on USERPROFILE · micropython/micropython@43a896b · GitHub
[go: up one dir, main page]

Skip to content

Commit 43a896b

Browse files
authored
mpremote: allow user configuration on Windows based on USERPROFILE
1 parent 8e912a5 commit 43a896b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-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` environ,ment variable).
226+
For example:
226227

227228
.. code-block:: python3
228229

tools/mpremote/mpremote/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,9 @@ def load_user_config():
337337
if path is None:
338338
path = os.getenv("HOME")
339339
if path is None:
340-
return config
340+
path = os.getenv("USERPROFILE")
341+
if path is None:
342+
return config
341343
path = os.path.join(path, ".config")
342344
path = os.path.join(path, _PROG)
343345
config_file = os.path.join(path, "config.py")

0 commit comments

Comments
 (0)
0