mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-25 19:38:56 +02:00
QMK CLI Environment bootstrapper (#25038)
Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Pascal Getreuer <getreuer@google.com>
This commit is contained in:
co-authored by
Joel Challis
Pascal Getreuer
parent
594558ec7b
commit
9c2ca00074
@@ -175,8 +175,9 @@ def keyboard_completer(prefix, action, parser, parsed_args):
|
||||
return list_keyboards()
|
||||
|
||||
|
||||
@lru_cache(maxsize=None)
|
||||
def list_keyboards():
|
||||
"""Returns a list of all keyboards
|
||||
"""Returns a list of all keyboards.
|
||||
"""
|
||||
# We avoid pathlib here because this is performance critical code.
|
||||
kb_wildcard = os.path.join(base_path, "**", 'keyboard.json')
|
||||
@@ -184,6 +185,9 @@ def list_keyboards():
|
||||
|
||||
found = map(_find_name, paths)
|
||||
|
||||
# Convert to posix paths for consistency
|
||||
found = map(lambda x: str(Path(x).as_posix()), found)
|
||||
|
||||
return sorted(set(found))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user