diff options
Diffstat (limited to '')
-rwxr-xr-x | templates/c/scripts/renew_copyright_header.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/templates/c/scripts/renew_copyright_header.sh b/templates/c/scripts/renew_copyright_header.sh index edb0a65..4f424c3 100755 --- a/templates/c/scripts/renew_copyright_header.sh +++ b/templates/c/scripts/renew_copyright_header.sh @@ -3,6 +3,7 @@ # NOTE: This is the line length of the .licensure.yml header template **plus** the extra # line after the template comment. TEMPLATE_LINE_LENGTH=20 +LATEX_TEMPLATE_LINE_LENGTH=9 PROJECT_ROOT="$(git rev-parse --show-toplevel)" @@ -17,6 +18,11 @@ remove() { "Makefile" | "toml" | "envrc" | "yml" | "gitignore" | "awk") sed --in-place "1,${TEMPLATE_LINE_LENGTH}d" "$file" ;; + # LaTeX files (or TeX files in general) have a different license, use the + # $LATEX_TEMPLATE_LINE_LENGTH variable. + "tex") + sed --in-place "1,${LATEX_TEMPLATE_LINE_LENGTH}d" "$file" + ;; # normal '/* ... */' like comments (these are $TEMPLATE_LINE_LENGTH + 2 lines long) "c" | "h" | "md" | "rs") length="$((TEMPLATE_LINE_LENGTH + 2))" @@ -66,7 +72,7 @@ if [ -f "$1" ]; then fi else fd --type file --hidden . | while read -r file; do - if grep --quiet 'SPDX-License-Identifier: GPL-3.0-or-later' "$file"; then + if grep --quiet 'SPDX-License-Identifier' "$file"; then filename="$(basename -- "$file")" extension="${filename##*.}" filename="${filename%.*}" |