forked from trinitrix/core
1
0
Fork 0

fix(scripts/renew_copyright_header): Update to the new copyright text

This commit is contained in:
Benedikt Peetz 2024-05-04 21:00:15 +02:00
parent d7e4159a26
commit a779fa250d
2 changed files with 6 additions and 5 deletions

View File

@ -158,6 +158,8 @@
packages = with pkgs; [
cocogitto
yq
rust_default
cargo-edit

9
scripts/renew_copyright_header.sh Normal file → Executable file
View File

@ -1,3 +1,4 @@
#! /usr/bin/env sh
# Copyright (C) 2024 - 2024:
# The Trinitrix Project <bpeetz@b-peetz.de, antifallobst@systemausfall.org>
# SPDX-License-Identifier: MIT
@ -24,11 +25,9 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#! /usr/bin/env sh
# NOTE: This is the line length of the .licensure.yml header template **plus** the extra
# line after the template comment.
TEMPLATE_LINE_LENGTH=20
TEMPLATE_LINE_LENGTH=26
LATEX_TEMPLATE_LINE_LENGTH=9
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
@ -41,7 +40,7 @@ remove() {
# formatters do weird things to the file
case "$extension" in
# normal '#' comments (these are $TEMPLATE_LINE_LENGTH lines long)
"Makefile" | "toml" | "envrc" | "yml" | "gitignore" | "awk" | "lua")
"Makefile" | "makefile" | "toml" | "envrc" | "yml" | "gitignore" | "awk" | "lua")
sed --in-place "1,${TEMPLATE_LINE_LENGTH}d" "$file"
;;
# LaTeX files (or TeX files in general) have a different license, use the
@ -50,7 +49,7 @@ remove() {
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" | "html" | "svg" | "drawio")
"c" | "h" | "md" | "rs" | "html" | "svg" | "drawio" | "tri")
length="$((TEMPLATE_LINE_LENGTH + 2))"
sed --in-place "1,${length}d;" "$file"
;;