etc-git: Be sure that git status is not empty before sending a mail
continuous-integration/drone/push Build encountered an error Details
continuous-integration/drone/pr Build encountered an error Details

This commit is contained in:
Benoît S. 2019-08-14 10:10:08 +02:00 committed by Benoît S
parent 8cc59a5a57
commit 76919c9649
1 changed files with 2 additions and 1 deletions

View File

@ -34,7 +34,8 @@ fi
# Send the mail if git status not empty
git --git-dir=/etc/.git --work-tree=/etc status --short > $gitOutput
if [ $gitOuput -n ]; then
gitOutputNumber=$(wc -l $gitOutput | awk '{ print $1 }')
if [ $gitOutputNumber -gt 0 ]; then
cat << EOT > $template
Content-Type: text/plain; charset="utf-8"
Reply-To: Équipe Evolix <equipe@evolix.fr>