Skip to content

Commit 1ea344b

Browse files
committed
Add copyright year updating
1 parent 05341c1 commit 1ea344b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

helpers/update-version.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@ if [ $? -ne 0 ]; then
2727
exit 1
2828
fi
2929

30-
if [ $? -eq 0 ]; then
31-
echo "Version updated to $NEW_VERSION in $FILE"
32-
else
33-
echo "Failed to update version in $FILE"
30+
# Update copyright end year if needed
31+
CURRENT_YEAR=$(date +%Y)
32+
# This will match lines like: // @copyright 2023–2025
33+
sed -i '' -E "s|(// @copyright[[:space:]]+[0-9]{4})–[0-9]{4}|\1–$CURRENT_YEAR|" "$FILE"
34+
if [ $? -ne 0 ]; then
35+
echo "Failed to update copyright year. Aborting."
3436
exit 1
3537
fi
38+
39+
echo "Version updated to $NEW_VERSION and copyright year set to $CURRENT_YEAR in $FILE"

0 commit comments

Comments
 (0)