From 25c97e0019aff7c529b09d177f23fd1271a120dc Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sun, 2 May 2021 16:59:10 +0100 Subject: [PATCH] Shim cli to new keyboard script (#12780) * Shim cli to new keyboard script * Shim cli to new keyboard script * Add docs --- docs/cli_commands.md | 12 ++++++++++++ lib/python/qmk/cli/new/__init__.py | 1 + lib/python/qmk/cli/new/keyboard.py | 11 +++++++++++ 3 files changed, 24 insertions(+) create mode 100644 lib/python/qmk/cli/new/keyboard.py diff --git a/docs/cli_commands.md b/docs/cli_commands.md index 6498b28b8..05e930607 100644 --- a/docs/cli_commands.md +++ b/docs/cli_commands.md @@ -228,6 +228,18 @@ This command is directory aware. It will automatically fill in KEYBOARD if you a qmk list-keymaps -kb planck/ez ``` +## `qmk new-keyboard` + +This command creates a new keyboard based on available templates. + +This command will prompt for input to guide you though the generation process. + +**Usage**: + +``` +qmk new-keyboard +``` + ## `qmk new-keymap` This command creates a new keymap based on a keyboard's existing default keymap. diff --git a/lib/python/qmk/cli/new/__init__.py b/lib/python/qmk/cli/new/__init__.py index c6a26939b..fe5d6fe48 100644 --- a/lib/python/qmk/cli/new/__init__.py +++ b/lib/python/qmk/cli/new/__init__.py @@ -1 +1,2 @@ +from . import keyboard from . import keymap diff --git a/lib/python/qmk/cli/new/keyboard.py b/lib/python/qmk/cli/new/keyboard.py new file mode 100644 index 000000000..cab0198fb --- /dev/null +++ b/lib/python/qmk/cli/new/keyboard.py @@ -0,0 +1,11 @@ +"""This script automates the creation of keyboards. +""" +from milc import cli + + +@cli.subcommand('Creates a new keyboard') +def new_keyboard(cli): + """Creates a new keyboard + """ + # TODO: replace this bodge to the existing script + cli.run(['util/new_keyboard.sh'], capture_output=False)