diff options
author | Nick Brassel <nick@tzarc.org> | 2023-11-29 01:07:21 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 14:07:21 +0000 |
commit | 049e964e61f20710bf789fa55f45c53e7236e9b2 (patch) | |
tree | 2f97f2cbb8e74341cde39159420c878ca6f2c6b3 /lib | |
parent | 0115951de12bd4c798a43a380651c34552552e85 (diff) |
Attempt to fix configurator. (#22555)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/python/qmk/userspace.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/python/qmk/userspace.py b/lib/python/qmk/userspace.py index 3783568006..103f11b99a 100644 --- a/lib/python/qmk/userspace.py +++ b/lib/python/qmk/userspace.py @@ -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) |