mirror of
https://github.com/corda/corda.git
synced 2025-01-01 02:36:44 +00:00
add script for updating copyright years based on most recent Git commit
This commit is contained in:
parent
f94d10cbba
commit
8d57e91971
12
update-copyright.sh
Normal file
12
update-copyright.sh
Normal file
@ -0,0 +1,12 @@
|
||||
for x in $(find -name *.S -or -name *.cpp -or -name *.h -or -name *.java | sort); do
|
||||
year_of_last_change=$(git log -1 --format=format:"%ai" $x | cut -c 1-4)
|
||||
copyright_years=$(grep "^/\* Copyright (c) .*, Avian Contributors$" $x | sed "s-^/\* Copyright (c) \(.*\), Avian Contributors\$-\1-")
|
||||
if [ "$copyright_years" != "" ]; then
|
||||
first_copyright_year=$(echo "$copyright_years" | sed "s/\(.*\)-.*/\1/")
|
||||
last_copyright_year=$(echo "$copyright_years" | sed "s/.*-\(.*\)/\1/")
|
||||
if [ "$last_copyright_year" != "$year_of_last_change" ]; then
|
||||
echo "$first_copyright_year-$year_of_last_change $x"
|
||||
sed -i "s:^/\* Copyright (c) .*, Avian Contributors\$:/* Copyright (c) $first_copyright_year-$year_of_last_change, Avian Contributors:" $x
|
||||
fi
|
||||
fi
|
||||
done
|
Loading…
Reference in New Issue
Block a user