From ce3ffbd9d31e7dfb5908ce45fe2ab0e612783d09 Mon Sep 17 00:00:00 2001 From: sixteenmillimeter Date: Fri, 12 Feb 2021 15:47:37 -0500 Subject: [PATCH] Add a build script for updating the library --- scripts/license.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/license.sh diff --git a/scripts/license.sh b/scripts/license.sh new file mode 100644 index 0000000..68ad039 --- /dev/null +++ b/scripts/license.sh @@ -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 +