diff options
Diffstat (limited to 'util')
| -rwxr-xr-x | util/new_keyboard.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/util/new_keyboard.sh b/util/new_keyboard.sh index e9ce30978..35d89e402 100755 --- a/util/new_keyboard.sh +++ b/util/new_keyboard.sh | |||
| @@ -70,6 +70,18 @@ replace_placeholders() { | |||
| 70 | echo " done" | 70 | echo " done" |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | # Replace %YEAR% with the current year. | ||
| 74 | replace_year_placeholders() { | ||
| 75 | local replace_year_filenames=( | ||
| 76 | "${keyboard_dir}/config.h" | ||
| 77 | "${keyboard_dir}/${keyboard_name}.c" | ||
| 78 | "${keyboard_dir}/${keyboard_name}.h" | ||
| 79 | "${keyboard_dir}/keymaps/default/config.h" | ||
| 80 | "${keyboard_dir}/keymaps/default/keymap.c" | ||
| 81 | ) | ||
| 82 | replace_placeholders "%YEAR%" "$(date +%Y)" "${replace_year_filenames[@]}" | ||
| 83 | } | ||
| 84 | |||
| 73 | # Replace %KEYBOARD% with the keyboard name. | 85 | # Replace %KEYBOARD% with the keyboard name. |
| 74 | replace_keyboard_placeholders() { | 86 | replace_keyboard_placeholders() { |
| 75 | local replace_keyboard_filenames=( | 87 | local replace_keyboard_filenames=( |
| @@ -149,6 +161,7 @@ echo | |||
| 149 | 161 | ||
| 150 | copy_templates | 162 | copy_templates |
| 151 | set_sed_i | 163 | set_sed_i |
| 164 | replace_year_placeholders | ||
| 152 | replace_keyboard_placeholders | 165 | replace_keyboard_placeholders |
| 153 | [ -n "$username" ] && replace_name_placeholders | 166 | [ -n "$username" ] && replace_name_placeholders |
| 154 | 167 | ||
