2022-11-30 02:30:19 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# This shell script updates the copyright headers in source code files
|
2025-06-17 17:08:15 +08:00
|
|
|
# in the current branch so that the headers conform to the pattern:
|
|
|
|
# <start-year>-present.
|
|
|
|
#
|
|
|
|
# For example, "Copyright 2002-2025" will be replaced with
|
|
|
|
# "Copyright 2002-current".
|
2022-11-30 02:30:19 +08:00
|
|
|
#
|
|
|
|
# This has only been tested on mac OS.
|
|
|
|
|
2025-06-17 17:08:15 +08:00
|
|
|
echo Updating copyright headers in Java, Kotlin, and Groovy source code
|
2022-11-30 02:30:19 +08:00
|
|
|
|
2025-06-17 17:08:15 +08:00
|
|
|
for file in $(find -E . -type f -regex '.+\.(java|kt|groovy)$' | uniq); do
|
|
|
|
sed -i '' -E "s/Copyright ([0-9]{4})-[0-9]{4}/Copyright \1-present/g" $file;
|
2022-11-30 22:16:17 +08:00
|
|
|
done
|