Workaround for resolving keyboard alias for config file values (#25228)

This commit is contained in:
Joel Challis 2025-05-05 01:22:51 +01:00 committed by GitHub
parent 60ac859852
commit cf5ce64b1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,7 @@ from time import monotonic
from milc import cli
from qmk.keyboard import find_keyboard_from_dir
from qmk.keyboard import find_keyboard_from_dir, keyboard_folder
from qmk.keymap import find_keymap_from_dir
@ -27,6 +27,11 @@ def automagic_keyboard(func):
def wrapper(*args, **kwargs):
cmd = _get_subcommand_name()
# TODO: Workaround for if config file contains "old" keyboard name
# Potential long-term fix needs to be within global cli or milc
if cli.config_source[cmd]['keyboard'] == 'config_file':
cli.config[cmd]['keyboard'] = keyboard_folder(cli.config[cmd]['keyboard'])
# Ensure that `--keyboard` was not passed and CWD is under `qmk_firmware/keyboards`
if cli.config_source[cmd]['keyboard'] != 'argument':
keyboard = find_keyboard_from_dir()