From cbf22398188b388c1912366cf4050697ab1b1f5c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 28 Apr 2020 11:21:36 +0200 Subject: [PATCH] bin/update: Fix early exit if no changes are found --- bin/update | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/update b/bin/update index 057b512f..16fd46e8 100755 --- a/bin/update +++ b/bin/update @@ -90,8 +90,13 @@ for repo_name in "${FETCHED_REPOS[@]}"; do done # Check for changes (new messages) that need to be committed -CHANGES=$(git diff -U0 | grep -Pe '^[+-]{1}[^+-]+' | grep -v -e '."Project-Id-Version:' -e '."POT-Creation-Date:'); -if [ -z "$CHANGES" ]; then +CHANGES=1 +git diff -U0 \ + | grep -Pe '^[+-]{1}[^+-]+' \ + | grep -qv -e '."Project-Id-Version:' -e '."POT-Creation-Date:' \ +|| CHANGES=0 + +if [ ! $CHANGES ]; then echo "No new messages found."; git checkout icinga.pot; else