Add decorators for determining keyboard and keymap based on current directory (#8191)
* Use pathlib everywhere we can * Improvements based on @erovia's feedback * rework qmk compile and qmk flash to use pathlib * style * Remove the subcommand_name argument from find_keyboard_keymap() * add experimental decorators * Create decorators for finding keyboard and keymap based on current directory. Decorators were inspired by @Erovia's brilliant work on the proof of concept.
This commit is contained in:
parent
5e98eaaaff
commit
f81b0e35a6
8 changed files with 152 additions and 99 deletions
|
@ -4,12 +4,15 @@ import shutil
|
|||
from pathlib import Path
|
||||
|
||||
import qmk.path
|
||||
from qmk.decorators import automagic_keyboard, automagic_keymap
|
||||
from milc import cli
|
||||
|
||||
|
||||
@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60hse')
|
||||
@cli.argument('-km', '--keymap', help='Specify the name for the new keymap directory')
|
||||
@cli.subcommand('Creates a new keymap for the keyboard of your choosing')
|
||||
@automagic_keyboard
|
||||
@automagic_keymap
|
||||
def new_keymap(cli):
|
||||
"""Creates a new keymap for the keyboard of your choosing.
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue