summaryrefslogtreecommitdiff
path: root/util/new_keyboard.sh
diff options
context:
space:
mode:
authorWilliam Chang <william@factual.com>2019-07-13 10:18:33 -0700
committerWilliam Chang <william@factual.com>2019-07-13 10:18:33 -0700
commit71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (patch)
tree3bb3e5e496621535611e087720aa5c4d7a533e5e /util/new_keyboard.sh
parent86ad4988fe7ff64916127509d84f44c56fa097aa (diff)
parentda1f05fbc19477c05c0c01bb07fabfaf1ece9d54 (diff)
Merge branch 'master' of https://github.com/qmk/qmk_firmware
Diffstat (limited to 'util/new_keyboard.sh')
-rwxr-xr-xutil/new_keyboard.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/util/new_keyboard.sh b/util/new_keyboard.sh
index e9ce309784..35d89e4026 100755
--- a/util/new_keyboard.sh
+++ b/util/new_keyboard.sh
@@ -70,6 +70,18 @@ replace_placeholders() {
echo " done"
}
+# Replace %YEAR% with the current year.
+replace_year_placeholders() {
+ local replace_year_filenames=(
+ "${keyboard_dir}/config.h"
+ "${keyboard_dir}/${keyboard_name}.c"
+ "${keyboard_dir}/${keyboard_name}.h"
+ "${keyboard_dir}/keymaps/default/config.h"
+ "${keyboard_dir}/keymaps/default/keymap.c"
+ )
+ replace_placeholders "%YEAR%" "$(date +%Y)" "${replace_year_filenames[@]}"
+}
+
# Replace %KEYBOARD% with the keyboard name.
replace_keyboard_placeholders() {
local replace_keyboard_filenames=(
@@ -149,6 +161,7 @@ echo
copy_templates
set_sed_i
+replace_year_placeholders
replace_keyboard_placeholders
[ -n "$username" ] && replace_name_placeholders