-
-
Notifications
You must be signed in to change notification settings - Fork 40.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve keyboard_aliases when processing keyboard make targets
- Loading branch information
Showing
3 changed files
with
41 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from qmk.keyboard import keyboard_folder | ||
|
||
from milc import cli | ||
|
||
|
||
@cli.argument('--allow-unknown', arg_only=True, action='store_true', help="Return original if rule is not a valid keyboard.") | ||
@cli.argument('keyboard', arg_only=True, help='The keyboard\'s name') | ||
@cli.subcommand('Resolve DEFAULT_FOLDER and any keyboard_aliases for provided rule') | ||
def resolve_alias(cli): | ||
try: | ||
print(keyboard_folder(cli.args.keyboard)) | ||
except ValueError: | ||
if cli.args.allow_unknown: | ||
print(cli.args.keyboard) | ||
else: | ||
raise |