瀏覽代碼

Make UpdateCopyright.sh script a bit more intelligent.

Change-Id: I88f633789679c6040268a83188004cf96a56037f
Reviewed-on: http://gerrit.dmdirc.com/2975
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.8rc1
Shane Mc Cormack 10 年之前
父節點
當前提交
2d080cf150
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11
    2
      UpdateCopyright.sh

+ 11
- 2
UpdateCopyright.sh 查看文件

@@ -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/' {} \;

Loading…
取消
儲存