From 5c3a318dc66c66c8e476083fba9084e340b07697 Mon Sep 17 00:00:00 2001 From: cyberta Date: Fri, 3 Jul 2026 15:41:48 +0200 Subject: ensure the right l10s branch is checked out when pulling metadata --- scripts/pull_metadata.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/scripts/pull_metadata.sh b/scripts/pull_metadata.sh index a9156a8c..50b9e301 100755 --- a/scripts/pull_metadata.sh +++ b/scripts/pull_metadata.sh @@ -3,7 +3,12 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" -L10N_DIR="$(cd "$PROJECT_ROOT/../l10n" && pwd)" +L10N_DIR="$(cd "$PROJECT_ROOT/../l10n" && pwd || echo Oops...)" +echo $L10N_DIR +if [ ! -d "$L10N_DIR" ]; then + echo "L10N_DIR not found: you need to checkout https://0xacab.org/leap/l10n/ next to the bitmask_android repository."; + exit 1 +fi MODE="${1:-normal}" # normal|custom case "$MODE" in @@ -11,15 +16,28 @@ case "$MODE" in *) echo "Usage: $0 [normal|custom]"; exit 1 ;; esac -SRC_GLOB="$L10N_DIR/bitmask-playstore-metadata/*.json" -OUT_BASE="$PROJECT_ROOT/src/${MODE}ProductionFat/fastlane/metadata/android" - command -v jq >/dev/null 2>&1 || { echo "Missing jq"; exit 1; } +# ensure the right l10n branch is checked out +cd $L10N_DIR +if [ ${MODE} == "normal" ]; then + git checkout bitmask-playstore + git pull + SRC_GLOB="$L10N_DIR/bitmask-playstore-metadata/*.json" +else + git checkout bitmask.riseupvpn-playstore-metadata + git pull + SRC_GLOB="$L10N_DIR/bitmask.riseupvpn-playstore-metadata/*.json" +fi +cd - + +OUT_BASE="$PROJECT_ROOT/src/${MODE}ProductionFat/fastlane/metadata/android" + +# iterate through translations and parse them to fastlane files for json in $SRC_GLOB; do [ -e "$json" ] || break lang="$(basename "$json" .json)" - echo "updating meta data for langauge $lang" + echo "updating meta data for language $lang" out_dir="$OUT_BASE/$lang" mkdir -p "$out_dir" -- cgit v1.2.3