From 5f44b86e264536b2dc22b5de0fc9fcc3c2543dbd Mon Sep 17 00:00:00 2001 From: Philipp Date: Tue, 5 Oct 2021 11:06:16 +0200 Subject: [PATCH] xgettext-addon.sh ignores deleted files --- transifex/xgettext-addon.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/transifex/xgettext-addon.sh b/transifex/xgettext-addon.sh index 039f756..aa001c2 100755 --- a/transifex/xgettext-addon.sh +++ b/transifex/xgettext-addon.sh @@ -4,10 +4,11 @@ # DIR=${FRIENDICA_DIR:-$PWD} ADDON_DIR=${FRIENDICA_ADDON_DIR:-"$DIR/addon"} +CHANGED_FILES=${CHANGED_FILES:-"${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER}"} -cd $ADDON_DIR -changed_files=($(git diff --name-status ${DRONE_COMMIT_BEFORE}..${DRONE_COMMIT_AFTER} | cut -f2 | sed '/^\./d' | cut -d "/" -f1 | uniq)) -cd $DIR +cd "$ADDON_DIR" || exit 1 +changed_files=($(git diff --diff-filter=ACM --name-status "${CHANGED_FILES}" | cut -f2 | sed '/^\./d' | cut -d "/" -f1 | uniq)) +cd "$DIR" || exit 1 for addon in "${changed_files[@]}"; do - ./bin/run_xgettext.sh --addon $addon; + ./bin/run_xgettext.sh --addon "$addon"; done