Skip to content

Commit

Permalink
improve .sh file
Browse files Browse the repository at this point in the history
  • Loading branch information
Frosty2500 committed Nov 27, 2024
1 parent 38b89bf commit 98a924c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion etc/scripts/set_copyright_year.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

while read -rd $'\0' year file; do
# Extract the first year from the copyright notice
current_year=$(sed -n '1,2s/^\(# Copyright (c) \)[^0-9]*\([0-9]\{4\}\)\([^\n]*\)/\2/p' "$file")
current_year=$(sed -n '1,2s/^\(# Copyright (c) \)\([[:digit:]]\{4,\}\).*/\2/p' "$file")


if $CHECK_MODE && [[ "$current_year" != "$year" ]]; then
echo "Error: Copyright year mismatch in file $file. Expected $year, found $current_year."
Expand Down

0 comments on commit 98a924c

Please sign in to comment.