|
@@ -1,7 +1,16 @@
|
1
|
1
|
#!/bin/sh
|
2
|
2
|
# Update Copyright headers in all files.
|
3
|
3
|
|
|
4
|
+MONTH=`date +%m`
|
4
|
5
|
THISYEAR=`date +%Y`
|
5
|
|
-THISYEAR=$((${THISYEAR} + 1))
|
6
|
6
|
|
7
|
|
-find . -regextype posix-egrep -iregex '.*/(.*\.(java|sh|php|xml|dpr|nsh|html|htm)|dmdirc.license|DMDirc-Apple.c|DMDirc - MIT|copyright)$' -exec sed -i 's/\(Copyright.*\)2006-20[0-9][0-9]\(.*DMDirc.*\)/\12006-'${THISYEAR}'\2/' {} \;
|
|
7
|
+if [ ${MONTH} -eq 12 ]; then
|
|
8
|
+ THISYEAR=$((${THISYEAR} + 1))
|
|
9
|
+elif [ ${MONTH} -ne 1 ]; then
|
|
10
|
+ echo "This script only makes sense being run near the start of a year..."
|
|
11
|
+ exit 1;
|
|
12
|
+fi;
|
|
13
|
+
|
|
14
|
+echo "Updating copyright to: ${THISYEAR}"
|
|
15
|
+
|
|
16
|
+find . -regextype posix-egrep -iregex '.*/(.*\.(java|sh|php|xml|dpr|nsh|html|htm)|dmdirc.license|LICENCE|DMDirc-Apple.c|DMDirc - MIT|copyright)$' -exec sed -i 's/\(Copyright.*\)2006-20[0-9][0-9]\(.*DMDirc.*\)/\12006-'${THISYEAR}'\2/' {} \;
|