Browse Source

Attempt to fix configurator. (#22555)

pull/22513/head
Nick Brassel 5 months ago
committed by GitHub
parent
commit
049e964e61
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions
  1. +7
    -6
      lib/python/qmk/userspace.py

+ 7
- 6
lib/python/qmk/userspace.py View File

@ -15,15 +15,16 @@ def qmk_userspace_paths():
test_dirs = []
# If we're already in a directory with a qmk.json and a keyboards or layouts directory, interpret it as userspace
current_dir = Path(environ['ORIG_CWD'])
while len(current_dir.parts) > 1:
if (current_dir / 'qmk.json').is_file():
test_dirs.append(current_dir)
current_dir = current_dir.parent
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.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.get('QMK_USERSPACE'))
current_dir = Path(environ['QMK_USERSPACE'])
if current_dir.is_dir():
test_dirs.append(current_dir)


Loading…
Cancel
Save