clean.py 553 B

1234567891011121314
  1. """Clean the QMK firmware folder of build artifacts.
  2. """
  3. from subprocess import DEVNULL
  4. from qmk.commands import create_make_target
  5. from milc import cli
  6. @cli.argument('-a', '--all', arg_only=True, action='store_true', help='Remove *.hex and *.bin files in the QMK root as well.')
  7. @cli.subcommand('Clean the QMK firmware folder of build artifacts.')
  8. def clean(cli):
  9. """Runs `make clean` (or `make distclean` if --all is passed)
  10. """
  11. cli.run(create_make_target('distclean' if cli.args.all else 'clean'), capture_output=False, stdin=DEVNULL)