From e8f9c591dce1b9a141d779e1aafa3de384e324bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20N=C3=BCsse?= Date: Sun, 28 Apr 2024 09:58:13 +0200 Subject: [PATCH] properly substitute line breaks --- .github/workflows/translations.yml | 3 --- scripts/generateFilelist.sh | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index b4dbd2de..d7cbb3b1 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -53,9 +53,6 @@ jobs: exit 1 fi TRANSLATIONS=$(./scripts/generateFilelist.sh ${{ github.event.pull_request.commits }} ${{needs.string-change-verification.outputs.files}}) - TRANSLATIONS="${TRANSLATIONS//'%'/'%25'}" - TRANSLATIONS="${TRANSLATIONS//$'\n'/'%0A'}" - TRANSLATIONS="${TRANSLATIONS//$'\r'/'%0D'}" echo "TRANSLATIONS=$TRANSLATIONS" >> $GITHUB_OUTPUT shell: sh - name: Upload Raw Translations diff --git a/scripts/generateFilelist.sh b/scripts/generateFilelist.sh index 04fd3368..e308f032 100755 --- a/scripts/generateFilelist.sh +++ b/scripts/generateFilelist.sh @@ -7,4 +7,8 @@ fi DIFF=$(git diff -U0 HEAD~$1 ${@:2} | grep -E "^\+" | grep -v +++ | cut -c 2- | sed 's/^[ \t]*\(.*$\)/\1/') echo "$DIFF" | xmlstarlet sel -t -m '//string' -v . -n > changed_texts.txt -cat changed_texts.txt +TRANSLATIONS=$(cat changed_texts.txt) +TRANSLATIONS="${TRANSLATIONS//'%'/'%25'}" +TRANSLATIONS="${TRANSLATIONS//$'\n'/'%0A'}" +TRANSLATIONS="${TRANSLATIONS//$'\r'/'%0D'}" +echo $TRANSLATIONS \ No newline at end of file