Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add script for updating copyright years based on most recent Git commit

  • Loading branch information...
commit 8d57e91971cc5d4f36bcac31ce7ea8260177e6be 1 parent f94d10c
@dicej dicej authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 update-copyright.sh
View
12 update-copyright.sh
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.