summaryrefslogtreecommitdiff
path: root/tools/update-copyright.sh
diff options
context:
space:
mode:
authorjak1 <jak1@themanaworld.org>2023-01-08 16:04:48 +0100
committerJesusaves <cpntb1@ymail.com>2024-02-08 21:49:11 -0300
commitd5d3f5818366b78f22793bf3fd89cd603c4dd63e (patch)
treea59fb3d2c4bbac5b629a72a0274c956e3c7c3720 /tools/update-copyright.sh
parent1d56e8f96def89ebcdd59ae85932353b52a973ec (diff)
downloadmv-d5d3f5818366b78f22793bf3fd89cd603c4dd63e.tar.gz
mv-d5d3f5818366b78f22793bf3fd89cd603c4dd63e.tar.bz2
mv-d5d3f5818366b78f22793bf3fd89cd603c4dd63e.tar.xz
mv-d5d3f5818366b78f22793bf3fd89cd603c4dd63e.zip
added manaverse' copyright line to src/
Diffstat (limited to 'tools/update-copyright.sh')
-rwxr-xr-xtools/update-copyright.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/update-copyright.sh b/tools/update-copyright.sh
index d681ebb7f..3c6673f57 100755
--- a/tools/update-copyright.sh
+++ b/tools/update-copyright.sh
@@ -4,17 +4,20 @@
# Copyright (C) 2012-2016 The ManaPlus Developers.
cd ..
-new_year="$1"
-[[ -z $new_year ]] && echo "Missing parameter: year" && exit 1
+if [[ $1 != "" ]]; then
+ new_year="$1"
+else
+ new_year=$(date +'%Y')
+fi
-[[ ! -e src ]] && echo "This script should be ran from the top manaplus dir" && exit 2
+[[ ! -e src ]] && echo "This script should be ran from the top manaplus dirs ./tools/ path." && exit 2
tmp_file="w$RANDOM$RANDOM$RANDOM$RANDOM"
[[ -e $tmp_file ]] && tmp_file="w$RANDOM$RANDOM$RANDOM$RANDOM"
# update the dates, creating the interval if it doesn't exist yet
find -iname "*.cpp" -or -iname "*.h" -or -iname "*.hpp" -or -iname "*.inc" -or -iname "*.cc" |
- xargs sed -i "/Copyright.*The ManaPlus Developers/ s,\(20[0-9]*\) \|\(20[0-9]*\)-20[0-9]* ,\1\2-$new_year ,"
+ xargs sed -i "/Copyright.*The ManaVerse Developers/ s,\(20[0-9]*\) \|\(20[0-9]*\)-20[0-9]* ,\1\2-$new_year ,"
# do a semi-automated commit check
git diff > $tmp_file