aboutsummaryrefslogtreecommitdiffstats
path: root/util/new_keyboard.sh
diff options
context:
space:
mode:
authorGravatar fauxpark <fauxpark@gmail.com>2019-07-09 07:07:36 +1000
committerGravatar MechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-07-08 14:07:35 -0700
commit8b1cdd1e3d27cce830c36f9604e5f69337b2c83e (patch)
treeb86e7057a654588457561ff70b70d1eadc947ac7 /util/new_keyboard.sh
parentdfebfecd48ebe972e7374e9ce26c795e3ddc88ae (diff)
downloadqmk_firmware-8b1cdd1e3d27cce830c36f9604e5f69337b2c83e.tar.gz
Add copyright year placeholders to new keyboard script (#6280)
* Add copyright year placeholders to new keyboard script * More copyright header tweaks
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 e9ce30978..35d89e402 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