diff options
author | Nick Brassel <[email protected]> | 2025-05-26 21:41:49 +1000 |
---|---|---|
committer | Nick Brassel <[email protected]> | 2025-05-26 21:41:49 +1000 |
commit | 75a037d2f0f9c54bad8e2f68ae82134559c92f22 (patch) | |
tree | 2b264de0e7a724c30cca511a9bac7ad29705d1a2 /lib/python/qmk/userspace.py | |
parent | 28720c4d343a9c5e9f5a62dbd583dbf536a2e61e (diff) | |
parent | 3703699757b6ce938ff412aca0a8b064927c0cdb (diff) | |
download | qmk_firmware-master.tar.gz qmk_firmware-master.zip |
Merge remote-tracking branch 'upstream/develop'master
Diffstat (limited to 'lib/python/qmk/userspace.py')
-rw-r--r-- | lib/python/qmk/userspace.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/python/qmk/userspace.py b/lib/python/qmk/userspace.py index 1c2a97f9c1..881490f796 100644 --- a/lib/python/qmk/userspace.py +++ b/lib/python/qmk/userspace.py @@ -12,29 +12,30 @@ from qmk.json_encoders import UserspaceJSONEncoder def qmk_userspace_paths(): - test_dirs = set() + test_dirs = [] # If we're already in a directory with a qmk.json and a keyboards or layouts directory, interpret it as userspace if environ.get('ORIG_CWD') is not None: current_dir = Path(environ['ORIG_CWD']) while len(current_dir.parts) > 1: if (current_dir / 'qmk.json').is_file(): - test_dirs.add(current_dir) + test_dirs.append(current_dir) current_dir = current_dir.parent # If we have a QMK_USERSPACE environment variable, use that if environ.get('QMK_USERSPACE') is not None: current_dir = Path(environ['QMK_USERSPACE']).expanduser() if current_dir.is_dir(): - test_dirs.add(current_dir) + test_dirs.append(current_dir) # If someone has configured a directory, use that if cli.config.user.overlay_dir is not None: current_dir = Path(cli.config.user.overlay_dir).expanduser().resolve() if current_dir.is_dir(): - test_dirs.add(current_dir) + test_dirs.append(current_dir) - return list(test_dirs) + # remove duplicates while maintaining the current order + return list(dict.fromkeys(test_dirs)) def qmk_userspace_validate(path): |