From b566cc74d5be661ab6fea80a2a68f63636287838 Mon Sep 17 00:00:00 2001 From: Giovanni Bussi <giovanni.bussi@gmail.com> Date: Mon, 12 Mar 2018 09:49:44 +0100 Subject: [PATCH] update headers to current year This will decrease the number of pull requests from PlumedBot. Currently, everytime a file is updated and someone forgets to run headers.sh, the headers are outdated. With this change, this will happen once per year. PlumedBot will thus mostly fix erroneous copyrights (rarely happening). --- src/header.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/header.sh b/src/header.sh index ec6e41f62..60f8fa46e 100755 --- a/src/header.sh +++ b/src/header.sh @@ -34,7 +34,10 @@ then else years=$(git log --follow -M75% --format=%aD $file | sort -r -n -k 4 | - awk '{if(NR==1)last=$4;}END{ + awk -v now="$(date +%Y)" '{if(NR==1)last=$4;}END{ +# override last with now + last=now +# Notice that the script could be simplified, I leave it as is for reference: first=$4 if(first=="") print "" else if(first==last) print first; -- GitLab