Skip to content

Commit

Permalink
Fix the path for generated keymaps (qmk#9213)
Browse files Browse the repository at this point in the history
  • Loading branch information
skullydazed authored and turky committed Jun 13, 2020
1 parent 20d1fde commit d6334de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 0 additions & 4 deletions lib/python/qmk/cli/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from milc import cli

import qmk.path
from qmk.decorators import automagic_keyboard, automagic_keymap
from qmk.commands import compile_configurator_json, create_make_command, parse_configurator_json

Expand All @@ -32,11 +31,8 @@ def compile(cli):
# If a configurator JSON was provided generate a keymap and compile it
# FIXME(skullydazed): add code to check and warn if the keymap already exists when compiling a json keymap.
user_keymap = parse_configurator_json(cli.args.filename)
keymap_path = qmk.path.keymap(user_keymap['keyboard'])
command = compile_configurator_json(user_keymap)

cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap'])

else:
if cli.config.compile.keyboard and cli.config.compile.keymap:
# Generate the make command for a specific keyboard/keymap.
Expand Down
6 changes: 5 additions & 1 deletion lib/python/qmk/keymap.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"""
from pathlib import Path

from milc import cli

from qmk.keyboard import rules_mk
import qmk.path

Expand Down Expand Up @@ -103,11 +105,13 @@ def write(keyboard, keymap, layout, layers):
An array of arrays describing the keymap. Each item in the inner array should be a string that is a valid QMK keycode.
"""
keymap_c = generate(keyboard, layout, layers)
keymap_file = qmk.path.keymap(keyboard) / 'keymap.c'
keymap_file = qmk.path.keymap(keyboard) / keymap / 'keymap.c'

keymap_file.parent.mkdir(parents=True, exist_ok=True)
keymap_file.write_text(keymap_c)

cli.log.info('Wrote keymap to {fg_cyan}%s', keymap_file)

return keymap_file


Expand Down

0 comments on commit d6334de

Please sign in to comment.