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
|
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'
|
||||||
|
|
Loading…
Reference in New Issue