chore: add a script to update BSL license change date

This commit is contained in:
Zaiming (Stone) Shi 2024-01-26 16:22:55 +01:00
parent 933c00c7ad
commit dd71a47d3f
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail
CONVERT_DATE="$(date -d "+4 years" '+%Y-%m-%d')"
NEWTEXT="Change Date: $CONVERT_DATE"
update() {
local file="$1"
sed -E "s#(^Change Date: *)(.*)#\1$CONVERT_DATE#g" -i "$file"
}
while read -r file; do
if [[ $file != *BSL.txt ]]; then
## Ignore other files
continue
fi
update "$file"
done < <(git ls-files)