mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-29 06:30:17 +00:00
Absolute paths for -kb argument should error consistently (#23262)
This commit is contained in:
parent
6788a5eb27
commit
fb11330eab
@ -12,11 +12,19 @@ from qmk.errors import NoSuchKeyboardError
|
|||||||
def is_keyboard(keyboard_name):
|
def is_keyboard(keyboard_name):
|
||||||
"""Returns True if `keyboard_name` is a keyboard we can compile.
|
"""Returns True if `keyboard_name` is a keyboard we can compile.
|
||||||
"""
|
"""
|
||||||
if keyboard_name:
|
if not keyboard_name:
|
||||||
keyboard_path = QMK_FIRMWARE / 'keyboards' / keyboard_name
|
return False
|
||||||
rules_mk = keyboard_path / 'rules.mk'
|
|
||||||
|
|
||||||
return rules_mk.exists()
|
# 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()
|
||||||
|
|
||||||
|
|
||||||
def under_qmk_firmware(path=Path(os.environ['ORIG_CWD'])):
|
def under_qmk_firmware(path=Path(os.environ['ORIG_CWD'])):
|
||||||
|
Loading…
Reference in New Issue
Block a user