瀏覽代碼

Merge remote-tracking branch 'origin/master' into develop

QMK Bot 3 年之前
父節點
當前提交
589bdedc47
共有 2 個文件被更改,包括 6 次插入4 次删除
  1. 3 2
      lib/python/qmk/cli/compile.py
  2. 3 2
      lib/python/qmk/cli/flash.py

+ 3 - 2
lib/python/qmk/cli/compile.py

@@ -32,8 +32,9 @@ def compile(cli):
     If a keyboard and keymap are provided this command will build a firmware based on that.
     """
     if cli.args.clean and not cli.args.filename and not cli.args.dry_run:
-        command = create_make_command(cli.config.compile.keyboard, cli.config.compile.keymap, 'clean')
-        cli.run(command, capture_output=False, stdin=DEVNULL)
+        if cli.config.compile.keyboard and cli.config.compile.keymap:
+            command = create_make_command(cli.config.compile.keyboard, cli.config.compile.keymap, 'clean')
+            cli.run(command, capture_output=False, stdin=DEVNULL)
 
     # Build the environment vars
     envs = {}

+ 3 - 2
lib/python/qmk/cli/flash.py

@@ -61,8 +61,9 @@ def flash(cli):
     If bootloader is omitted the make system will use the configured bootloader for that keyboard.
     """
     if cli.args.clean and not cli.args.filename and not cli.args.dry_run:
-        command = create_make_command(cli.config.flash.keyboard, cli.config.flash.keymap, 'clean')
-        cli.run(command, capture_output=False, stdin=DEVNULL)
+        if cli.config.flash.keyboard and cli.config.flash.keymap:
+            command = create_make_command(cli.config.flash.keyboard, cli.config.flash.keymap, 'clean')
+            cli.run(command, capture_output=False, stdin=DEVNULL)
 
     # Build the environment vars
     envs = {}