From 4ca3fb08352aa781d96ce825c37e998568084e11 Mon Sep 17 00:00:00 2001 From: Marcos Marado Date: Sun, 20 May 2018 00:06:30 +0100 Subject: [PATCH] Scripts agora alteram o README automaticamente --- scripts/01-parlamento.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/01-parlamento.sh b/scripts/01-parlamento.sh index 48da037..925b6d5 100755 --- a/scripts/01-parlamento.sh +++ b/scripts/01-parlamento.sh @@ -28,5 +28,11 @@ if [ ! "$b" -eq "0" ]; then echo "Incumprimento 'b' (flash no canal paralamento) pode estar resolvido ($b)."; fi if [ $((a + b)) -eq "0" ]; then - echo "parlamento: incumprimento mantém-se, actualizar README"; + echo "parlamento: incumprimento mantém-se, a actualizar README (faça um git diff, valide, e commit!)"; + while IFS='' read -r line || [[ -n "$line" ]]; do + test $(echo "$line"|grep -v www.parlamento.pt|wc -l) -eq "1" \ + && echo "$line" \ + || (h=$(echo "$line"|cut -d\| -f1-4); t=$(echo "$line"|cut -d\| -f6-); echo "$h| $(date +%Y/%m/%d) |$t"); + done < README.md > new + mv new README.md fi