Skip to content

Commit

Permalink
Add copyright year placeholders to new keyboard script (qmk#6280)
Browse files Browse the repository at this point in the history
* Add copyright year placeholders to new keyboard script

* More copyright header tweaks
  • Loading branch information
fauxpark authored and mechmerlin committed Jul 8, 2019
1 parent dfebfec commit 8b1cdd1
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 32 deletions.
2 changes: 1 addition & 1 deletion quantum/template/avr/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019 %YOUR_NAME%
Copyright %YEAR% %YOUR_NAME%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion quantum/template/avr/template.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2019 %YOUR_NAME%
/* Copyright %YEAR% %YOUR_NAME%
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion quantum/template/base/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2019 %YOUR_NAME%
/* Copyright %YEAR% %YOUR_NAME%
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion quantum/template/base/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2019 %YOUR_NAME%
/* Copyright %YEAR% %YOUR_NAME%
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion quantum/template/base/template.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2019 %YOUR_NAME%
/* Copyright %YEAR% %YOUR_NAME%
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion quantum/template/ps2avrgb/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
Copyright %YEAR% %YOUR_NAME%
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
15 changes: 0 additions & 15 deletions quantum/template/ps2avrgb/rules.mk
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
# Copyright 2019 Luiz Ribeiro <luizribeiro@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

# MCU name
MCU = atmega32a
PROTOCOL = VUSB
Expand Down
2 changes: 1 addition & 1 deletion quantum/template/ps2avrgb/template.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2019 %YOUR_NAME%
/* Copyright %YEAR% %YOUR_NAME%
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
10 changes: 0 additions & 10 deletions quantum/template/ps2avrgb/usbconfig.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
/* Name: usbconfig.h
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
* Author: Christian Starkjohann
* Creation Date: 2005-04-01
* Tabsize: 4
* Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
*/

#pragma once

#include "config.h"
Expand Down
13 changes: 13 additions & 0 deletions util/new_keyboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand Down Expand Up @@ -149,6 +161,7 @@ echo

copy_templates
set_sed_i
replace_year_placeholders
replace_keyboard_placeholders
[ -n "$username" ] && replace_name_placeholders

Expand Down

0 comments on commit 8b1cdd1

Please sign in to comment.