1
0
Fork 0

Updated copyright script to place current date in license templates

perfodd
Mike Gerwitz 2013-12-20 01:16:18 -05:00
parent 13ca9cd852
commit 34a36b8e1d
No known key found for this signature in database
GPG Key ID: F22BB8158EE30EAB
1 changed files with 14 additions and 1 deletions

View File

@ -68,6 +68,14 @@ read -p 'Are you sure you want to continue (y/N)? ' c
exit 1 exit 1
} }
copyupdate()
{
years="$1"
file="$2"
sed -i "s/\(. \+Copyright (C) \).*\$/\\1$years $owner/" "$file"
}
# have at it # have at it
for file in $files; do for file in $files; do
ext="${file##*/*.}" ext="${file##*/*.}"
@ -91,9 +99,14 @@ for file in $files; do
fi fi
# perform copyright update # perform copyright update
sed -i "s/\(. \+Copyright (C) \).*\$/\\1$years $owner/" "$file" copyupdate "$years" "$file"
echo "$years." echo "$years."
done done
# general files
year="$( date +%Y )"
copyupdate "$year" license.tpl
copyupdate "$year" license-min.tpl
# commit # commit
git commit -am '[copyright] Copyright update' git commit -am '[copyright] Copyright update'