Add a build script for updating the library

This commit is contained in:
Matt McWilliams 2021-02-12 15:47:37 -05:00
parent 39529b9038
commit ce3ffbd9d3
1 changed files with 12 additions and 0 deletions

12
scripts/license.sh Normal file
View File

@ -0,0 +1,12 @@
#!/bin/bash
YEAR=`cat LICENSE.txt | grep "^Copyright" | awk '{print $3}'`
NOW=`date '+%Y'`
if [ $NOW -gt $YEAR ]; then
echo "Current year $NOW > $YEAR, updating license..."
LICENSE=`cat LICENSE.txt`
UPDATED=`echo "${LICENSE}" | sed "s/${YEAR}/${NOW}/"`
echo "${UPDATED}" > LICENSE.txt
fi