From 34a36b8e1da7a58061071c1be788674ec5c4cb5e Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 20 Dec 2013 01:16:18 -0500 Subject: [PATCH] Updated copyright script to place current date in license templates --- tools/copyright | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/copyright b/tools/copyright index ea09a4e..e504109 100755 --- a/tools/copyright +++ b/tools/copyright @@ -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'