Files
spring-data-build/etc/scripts/update-license-headers
Oliver Drotbohm 78b1278317 #959 - Added Bash scripts to update the copyright years of Java source files.
Usage is described by executing the scripts without parameters.
2020-01-10 12:40:42 +01:00

10 lines
495 B
Bash
Executable File

#!/bin/bash
#
# This script updates the license headers of all Java files to extend the copyright year to the given date.
USAGE="$0 <year>"
if [ $# -lt 1 ]; then echo -e "ERROR: Year required. \n$USAGE" >&2; exit 1; fi
YEAR=$1
for file in `find . -name '*.java' `; do sed -E -i '' "s/\* Copyright ([0-9]{4})-([0-9]{4}) the/\* Copyright \1-${YEAR} the/g" $file; done
for file in `find . -name '*.java' `; do sed -E -i '' "s/\* Copyright ([0-9]{4}) the/\* Copyright \1-${YEAR} the/g" $file; done