diff options
Diffstat (limited to 'bin/qmk')
| -rwxr-xr-x | bin/qmk | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/bin/qmk b/bin/qmk deleted file mode 100755 index 617f99282..000000000 --- a/bin/qmk +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | #!/usr/bin/env python3 | ||
| 2 | """CLI wrapper for running QMK commands. | ||
| 3 | """ | ||
| 4 | import os | ||
| 5 | import sys | ||
| 6 | from pathlib import Path | ||
| 7 | |||
| 8 | # Add the QMK python libs to our path | ||
| 9 | script_dir = Path(os.path.realpath(__file__)).parent | ||
| 10 | qmk_dir = script_dir.parent | ||
| 11 | python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve() | ||
| 12 | sys.path.append(str(python_lib_dir)) | ||
| 13 | |||
| 14 | # Setup the CLI | ||
| 15 | import milc # noqa | ||
| 16 | |||
| 17 | milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}' | ||
| 18 | |||
| 19 | |||
| 20 | @milc.cli.entrypoint('QMK Helper Script') | ||
| 21 | def qmk_main(cli): | ||
| 22 | """The function that gets run when no subcommand is provided. | ||
| 23 | """ | ||
| 24 | cli.print_help() | ||
| 25 | |||
| 26 | |||
| 27 | def main(): | ||
| 28 | """Setup our environment and then call the CLI entrypoint. | ||
| 29 | """ | ||
| 30 | # Change to the root of our checkout | ||
| 31 | os.environ['ORIG_CWD'] = os.getcwd() | ||
| 32 | os.environ['DEPRECATED_BIN_QMK'] = '1' | ||
| 33 | os.chdir(qmk_dir) | ||
| 34 | |||
| 35 | print('Warning: The bin/qmk script is being deprecated. Please install the QMK CLI: python3 -m pip install qmk', file=sys.stderr) | ||
| 36 | |||
| 37 | # Import the subcommands | ||
| 38 | import milc.subcommand.config # noqa | ||
| 39 | import qmk.cli # noqa | ||
| 40 | |||
| 41 | # Execute | ||
| 42 | return_code = milc.cli() | ||
| 43 | |||
| 44 | if return_code is False: | ||
| 45 | exit(1) | ||
| 46 | |||
| 47 | elif return_code is not True and isinstance(return_code, int): | ||
| 48 | if return_code < 0 or return_code > 255: | ||
| 49 | milc.cli.log.error('Invalid return_code: %d', return_code) | ||
| 50 | exit(255) | ||
| 51 | |||
| 52 | exit(return_code) | ||
| 53 | |||
| 54 | exit(0) | ||
| 55 | |||
| 56 | |||
| 57 | if __name__ == '__main__': | ||
| 58 | main() | ||
