aboutsummaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/generate/layouts.py
diff options
context:
space:
mode:
authorZach White <skullydazed@gmail.com>2021-05-21 16:59:10 -0700
committerGitHub <noreply@github.com>2021-05-21 16:59:10 -0700
commit4c0d8ae8d77a76857abf4befc13d8f6c969c52e0 (patch)
tree9c7bef9b269be9becd920014a6eaca2ef4fc4468 /lib/python/qmk/cli/generate/layouts.py
parentde8fada3a3635f0fc6f1509ea2c0ac53ee880cf5 (diff)
downloadqmk_firmware-4c0d8ae8d77a76857abf4befc13d8f6c969c52e0.tar.gz
qmk_firmware-4c0d8ae8d77a76857abf4befc13d8f6c969c52e0.zip
ensure we do not conflict with existing keymap aliases (#12976)
Diffstat (limited to 'lib/python/qmk/cli/generate/layouts.py')
-rwxr-xr-xlib/python/qmk/cli/generate/layouts.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/generate/layouts.py b/lib/python/qmk/cli/generate/layouts.py
index ad6946d6c..4de982f82 100755
--- a/lib/python/qmk/cli/generate/layouts.py
+++ b/lib/python/qmk/cli/generate/layouts.py
@@ -85,7 +85,9 @@ def generate_layouts(cli):
85 85
86 for alias, target in kb_info_json.get('layout_aliases', {}).items(): 86 for alias, target in kb_info_json.get('layout_aliases', {}).items():
87 layouts_h_lines.append('') 87 layouts_h_lines.append('')
88 layouts_h_lines.append('#define %s %s' % (alias, target)) 88 layouts_h_lines.append(f'#ifndef {alias}')
89 layouts_h_lines.append(f'# define {alias} {target}')
90 layouts_h_lines.append('#endif')
89 91
90 # Show the results 92 # Show the results
91 layouts_h = '\n'.join(layouts_h_lines) + '\n' 93 layouts_h = '\n'.join(layouts_h_lines) + '\n'