2022-01-02 00:12:05 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-01-02 00:20:03 +01:00
|
|
|
# Reset
|
|
|
|
Color_Off='\033[0m' # Text Reset
|
|
|
|
|
|
|
|
# Regular Colors
|
|
|
|
Black='\033[0;30m' # Black
|
|
|
|
Red='\033[0;31m' # Red
|
|
|
|
Green='\033[0;32m' # Green
|
|
|
|
Yellow='\033[0;33m' # Yellow
|
|
|
|
Blue='\033[0;34m' # Blue
|
|
|
|
Purple='\033[0;35m' # Purple
|
|
|
|
Cyan='\033[0;36m' # Cyan
|
|
|
|
White='\033[0;37m' # White
|
|
|
|
|
2022-01-02 00:12:05 +01:00
|
|
|
exitcode=0
|
|
|
|
|
|
|
|
supportedlangs=(af ar am hy-AM az-AZ eu-ES be bn-BD bg my-MM ca zh-HK zh-CN zh-TW hr cs-CZ da-DK nl-NL en-AU en-CA en-IN en-SG en-GB en-US et fil fi-FI fr-FR fr-CA gl-ES ka-GE de-DE el-GR iw-IL hi-IN hu-HU is-IS id it-IT ja-JP kn-IN km-KH ko-KR ky-KG lo-LA lv lt mk-MK ms ml-IN mr-IN mn-MN ne-NP no-NO fa pl-PL pt-BR pt-PT ro rm ru-RU sr si-LK sk sl es-419 es-ES es-US sq sw sv-SE ta-IN te-IN th tr-TR uk vi zu)
|
|
|
|
|
|
|
|
readarray -t dirs < <(find fastlane/metadata/android -mindepth 1 -maxdepth 1 -type d -printf '%P\n')
|
|
|
|
|
2022-01-02 00:20:03 +01:00
|
|
|
echo -e "${Green}Checking for Valid fastlane files...${Color_Off}"
|
2022-01-02 00:12:05 +01:00
|
|
|
|
|
|
|
for target in "${supportedlangs[@]}"; do
|
|
|
|
for i in "${!dirs[@]}"; do
|
|
|
|
if [[ ${dirs[i]} = $target ]]; then
|
|
|
|
unset 'dirs[i]'
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ ${#dirs[@]} -gt 0 ]]; then
|
|
|
|
exitcode=1
|
2022-01-02 00:20:03 +01:00
|
|
|
echo -e "${Red}Invalid Lang Play Store Listing found: ${#dirs[@]}${Color_Off}"
|
|
|
|
echo -e "${Red}Invalid Lang codes:${dirs[@]}${Color_Off}"
|
2022-01-02 00:12:05 +01:00
|
|
|
else
|
2022-01-02 00:20:03 +01:00
|
|
|
echo -e "${Green}All found lang codes are valid${Color_Off}"
|
2022-01-02 00:12:05 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# check we have required files
|
|
|
|
|
2022-01-02 15:31:50 +01:00
|
|
|
requiredfiles=(title.txt full_description.txt short_description.txt)
|
2022-01-02 00:12:05 +01:00
|
|
|
|
|
|
|
for d in fastlane/metadata/android/* ; do
|
|
|
|
[ -L "${d%/}" ] && continue
|
|
|
|
for rfile in "${requiredfiles[@]}"; do
|
|
|
|
if test ! -f "$d/$rfile"; then
|
2022-01-02 00:20:03 +01:00
|
|
|
echo -e "${Red}$d/$rfile missing.${Color_Off}"
|
2022-01-02 00:12:05 +01:00
|
|
|
exitcode=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
# check title is under 30 characters
|
|
|
|
if test -f "$d/title.txt"; then
|
|
|
|
if [[ $(wc -m < "$d/title.txt") -gt 30 ]]; then
|
2022-01-02 00:20:03 +01:00
|
|
|
echo -e "${Red}$d/title.txt title too long.${Color_Off}"
|
2022-01-02 00:12:05 +01:00
|
|
|
exitcode=1
|
|
|
|
fi
|
|
|
|
fi
|
2022-01-02 01:05:08 +01:00
|
|
|
|
2022-01-02 15:31:50 +01:00
|
|
|
# if test -f "$d/video.txt"; then
|
|
|
|
# fcontents=$(cat "$d/video.txt")
|
|
|
|
# if [[ "$fcontents" != "https://www.youtube.com/watch?v=lVJs26gE2Ek" ]]; then
|
|
|
|
# exitcode=1
|
|
|
|
# echo -e "${Blue}$fcontents${Color_Off} --> $d/video.txt - not correct video URL"
|
|
|
|
# fi
|
|
|
|
# fi
|
2022-01-02 00:12:05 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
exit $exitcode
|