diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-04-01 13:09:06 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-04-01 13:09:06 +0200 |
commit | c2b20568121db07fe4ba16703f7c319cd398939a (patch) | |
tree | fb2c310e171a49f511a384744e4e58590728ac2d | |
parent | fix(common/.licensure.yml): Remove one last reference to Trixy (diff) | |
download | flake-templates-c2b20568121db07fe4ba16703f7c319cd398939a.tar.gz flake-templates-c2b20568121db07fe4ba16703f7c319cd398939a.zip |
fix(common/scripts/renew_copyright_header): Add support for TeX files
-rwxr-xr-x | common/scripts/renew_copyright_header.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/scripts/renew_copyright_header.sh b/common/scripts/renew_copyright_header.sh index edb0a65..4f424c3 100755 --- a/common/scripts/renew_copyright_header.sh +++ b/common/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%.*}" |