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