From 23a64412ed881c30cab60b52ebeefd50088d2c0a Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Tue, 3 Aug 2021 10:05:57 -0300 Subject: [PATCH] Use correct language code from sources. (#8374) --- .github/scripts/create-repo.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/scripts/create-repo.sh b/.github/scripts/create-repo.sh index 87198182f..1b5766f05 100755 --- a/.github/scripts/create-repo.sh +++ b/.github/scripts/create-repo.sh @@ -31,6 +31,17 @@ for APK in ${APKS[@]}; do unzip -p $APK $ICON > icon/${FILENAME%.*}.png SOURCE_INFO=$(jq ".[\"$PKGNAME\"]" < ../output.json) + + # Fixes the language code without needing to update the packages. + SOURCE_LEN=$(echo $SOURCE_INFO | jq length) + + if [ $SOURCE_LEN = "1" ]; then + SOURCE_LANG=$(echo $SOURCE_INFO | jq -r '.[0].lang') + + if [ $SOURCE_LANG != $LANG ] && [ $SOURCE_LANG != "all" ] && [ $SOURCE_LANG != "other" ]; then + LANG=$SOURCE_LANG + fi + fi jq -n \ --arg name "$LABEL" \