Skip to content

Commit 52e967a

Browse files
committed
Apply update_copyright_headers.sh to staged files as well
1 parent 1de9d12 commit 52e967a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

update_copyright_headers.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
current_year=$(date +'%Y')
1111
echo Updating copyright headers in Java, Kotlin, and Groovy source code for year $current_year
1212

13+
# Added/Modified this year and committed
1314
for file in $(git --no-pager diff --name-only --diff-filter=AM @{$current_year-01-01}..@{$current_year-12-31} | egrep "^.+\.(java|kotlin|groovy)$" | uniq); do
1415
sed -i '' -E "s/Copyright 2002-[0-9]{4}/Copyright 2002-$current_year/g" $file;
1516
done
17+
18+
# Added/Modified and staged but not yet committed
19+
for file in $(git --no-pager diff --name-only --diff-filter=AM --cached | egrep "^.+\.(java|kotlin|groovy)$" | uniq); do
20+
sed -i '' -E "s/Copyright 2002-[0-9]{4}/Copyright 2002-$current_year/g" $file;
21+
done

0 commit comments

Comments
 (0)