diff options
| author | Joel Challis <git@zvecr.com> | 2023-11-01 22:37:05 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-01 22:37:05 +0000 |
| commit | 8ea955c72ff9c2888a08c9b6b2f5dda8b49eb856 (patch) | |
| tree | 425166e843c8d897e77e44f68a9e3abbe42d13d1 /lib/python/qmk/path.py | |
| parent | a27bc60703dda744309c5f13320f667f5c766260 (diff) | |
Improve argument handling of c2json (#22170)
* Improve argument handling of c2json
* Add automagic
Diffstat (limited to 'lib/python/qmk/path.py')
| -rw-r--r-- | lib/python/qmk/path.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py index 9d248451b8..94582a05e0 100644 --- a/lib/python/qmk/path.py +++ b/lib/python/qmk/path.py | |||
| @@ -19,13 +19,11 @@ def is_keyboard(keyboard_name): | |||
| 19 | return rules_mk.exists() | 19 | return rules_mk.exists() |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | def under_qmk_firmware(): | 22 | def under_qmk_firmware(path=Path(os.environ['ORIG_CWD'])): |
| 23 | """Returns a Path object representing the relative path under qmk_firmware, or None. | 23 | """Returns a Path object representing the relative path under qmk_firmware, or None. |
| 24 | """ | 24 | """ |
| 25 | cwd = Path(os.environ['ORIG_CWD']) | ||
| 26 | |||
| 27 | try: | 25 | try: |
| 28 | return cwd.relative_to(QMK_FIRMWARE) | 26 | return path.relative_to(QMK_FIRMWARE) |
| 29 | except ValueError: | 27 | except ValueError: |
| 30 | return None | 28 | return None |
| 31 | 29 | ||
