Skip to content

Commit

Permalink
Use correct Kotlin file extension in update_copyright_headers.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrannen committed Feb 19, 2023
1 parent 38a4f23 commit bb6150e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions update_copyright_headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ current_year=$(date +'%Y')
echo Updating copyright headers in Java, Kotlin, and Groovy source code for year $current_year

# Added/Modified this year and committed
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
for file in $(git --no-pager diff --name-only --diff-filter=AM @{$current_year-01-01}..@{$current_year-12-31} | egrep "^.+\.(java|kt|groovy)$" | uniq); do
sed -i '' -E "s/Copyright 2002-[0-9]{4}/Copyright 2002-$current_year/g" $file;
done

# Added/Modified and staged but not yet committed
for file in $(git --no-pager diff --name-only --diff-filter=AM --cached | egrep "^.+\.(java|kotlin|groovy)$" | uniq); do
for file in $(git --no-pager diff --name-only --diff-filter=AM --cached | egrep "^.+\.(java|kt|groovy)$" | uniq); do
sed -i '' -E "s/Copyright 2002-[0-9]{4}/Copyright 2002-$current_year/g" $file;
done

0 comments on commit bb6150e

Please sign in to comment.