diff options
Diffstat (limited to 'lib/python/qmk/cli/json2c.py')
| -rwxr-xr-x | lib/python/qmk/cli/json2c.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/python/qmk/cli/json2c.py b/lib/python/qmk/cli/json2c.py index 521840507..af0d80a9a 100755 --- a/lib/python/qmk/cli/json2c.py +++ b/lib/python/qmk/cli/json2c.py | |||
| @@ -18,19 +18,19 @@ def json2c(cli): | |||
| 18 | This command uses the `qmk.keymap` module to generate a keymap.c from a configurator export. The generated keymap is written to stdout, or to a file if -o is provided. | 18 | This command uses the `qmk.keymap` module to generate a keymap.c from a configurator export. The generated keymap is written to stdout, or to a file if -o is provided. |
| 19 | """ | 19 | """ |
| 20 | # Error checking | 20 | # Error checking |
| 21 | if not cli.args.filename.exists(): | 21 | if cli.args.filename and cli.args.filename.name == '-': |
| 22 | cli.log.error('JSON file does not exist!') | 22 | # TODO(skullydazed/anyone): Read file contents from STDIN |
| 23 | cli.log.error('Reading from STDIN is not (yet) supported.') | ||
| 23 | cli.print_usage() | 24 | cli.print_usage() |
| 24 | exit(1) | 25 | exit(1) |
| 25 | 26 | ||
| 26 | if cli.args.filename.name == '-': | 27 | if not cli.args.filename.exists(): |
| 27 | # TODO(skullydazed/anyone): Read file contents from STDIN | 28 | cli.log.error('JSON file does not exist!') |
| 28 | cli.log.error('Reading from STDIN is not (yet) supported.') | ||
| 29 | cli.print_usage() | 29 | cli.print_usage() |
| 30 | exit(1) | 30 | exit(1) |
| 31 | 31 | ||
| 32 | # Environment processing | 32 | # Environment processing |
| 33 | if cli.args.output.name == ('-'): | 33 | if cli.args.output and cli.args.output.name == '-': |
| 34 | cli.args.output = None | 34 | cli.args.output = None |
| 35 | 35 | ||
| 36 | # Parse the configurator json | 36 | # Parse the configurator json |
