Browse Source

Absolute paths for -kb argument should error consistently (#23262)

pull/23269/head
Joel Challis 1 month ago
committed by GitHub
parent
commit
fb11330eab
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      lib/python/qmk/path.py

+ 12
- 4
lib/python/qmk/path.py View File

@ -12,11 +12,19 @@ from qmk.errors import NoSuchKeyboardError
def is_keyboard(keyboard_name):
"""Returns True if `keyboard_name` is a keyboard we can compile.
"""
if keyboard_name:
keyboard_path = QMK_FIRMWARE / 'keyboards' / keyboard_name
rules_mk = keyboard_path / 'rules.mk'
if not keyboard_name:
return False
# keyboard_name values of 'c:/something' or '/something' trigger append issues
# due to "If the argument is an absolute path, the previous path is ignored"
# however it should always be a folder located under qmk_firmware/keyboards
if Path(keyboard_name).is_absolute():
return False
keyboard_path = QMK_FIRMWARE / 'keyboards' / keyboard_name
rules_mk = keyboard_path / 'rules.mk'
return rules_mk.exists()
return rules_mk.exists()
def under_qmk_firmware(path=Path(os.environ['ORIG_CWD'])):


Loading…
Cancel
Save