diff options
author | Joel Challis <[email protected]> | 2023-11-01 22:37:05 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-01 22:37:05 +0000 |
commit | 8ea955c72ff9c2888a08c9b6b2f5dda8b49eb856 (patch) | |
tree | 425166e843c8d897e77e44f68a9e3abbe42d13d1 /lib/python/qmk/path.py | |
parent | a27bc60703dda744309c5f13320f667f5c766260 (diff) | |
download | qmk_firmware-8ea955c72ff9c2888a08c9b6b2f5dda8b49eb856.tar.gz qmk_firmware-8ea955c72ff9c2888a08c9b6b2f5dda8b49eb856.zip |
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): return rules_mk.exists() -def under_qmk_firmware(): +def under_qmk_firmware(path=Path(os.environ['ORIG_CWD'])): """Returns a Path object representing the relative path under qmk_firmware, or None. """ - cwd = Path(os.environ['ORIG_CWD']) - try: - return cwd.relative_to(QMK_FIRMWARE) + return path.relative_to(QMK_FIRMWARE) except ValueError: return None |