about summary refs log tree commit diff stats
path: root/templates/shell
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-04-01 13:09:55 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-04-01 13:09:55 +0200
commitd37315e8a9cb012ed82898d623235abc62d3e3f9 (patch)
treed2b2036bb4b53aba523bb135e32ff64c3b4e9ab7 /templates/shell
parentfix(common/scripts/renew_copyright_header): Add support for TeX files (diff)
downloadflake-templates-d37315e8a9cb012ed82898d623235abc62d3e3f9.tar.gz
flake-templates-d37315e8a9cb012ed82898d623235abc62d3e3f9.zip
chore(version): v0.4.1
Diffstat (limited to 'templates/shell')
-rw-r--r--templates/shell/.licensure.yml6
-rwxr-xr-xtemplates/shell/scripts/renew_copyright_header.sh8
2 files changed, 10 insertions, 4 deletions
diff --git a/templates/shell/.licensure.yml b/templates/shell/.licensure.yml
index b7f963a..80d8f71 100644
--- a/templates/shell/.licensure.yml
+++ b/templates/shell/.licensure.yml
@@ -21,10 +21,10 @@ licenses:
         email: "benedikt.peetz@b-peetz.de"
 
     template: |
-      <TODO> 2024 - [year] (C) by [name of author]
+      TODO 2024 - [year] (C) by [name of author]
       SPDX-License-Identifier: CC-BY-SA-4.0
 
-      <TODO> is licensed under a
+      TODO is licensed under a
       Creative Commons Attribution-ShareAlike 4.0 International License.
 
       You should have received a copy of the license along with this
@@ -68,7 +68,7 @@ licenses:
 
         This file is part of the TODO.
 
-        Trixy is free software: you can redistribute it and/or modify
+        TODO is free software: you can redistribute it and/or modify
         it under the terms of the Lesser GNU General Public License as
         published by the Free Software Foundation, either version 3 of
         the License, or (at your option) any later version.
diff --git a/templates/shell/scripts/renew_copyright_header.sh b/templates/shell/scripts/renew_copyright_header.sh
index edb0a65..4f424c3 100755
--- a/templates/shell/scripts/renew_copyright_header.sh
+++ b/templates/shell/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%.*}"