Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930#!/bin/bashset -euo pipefailshopt -s nullglobroot=$(cd "$(dirname "$0")/.." && pwd)if [[ $# -ne 2 || $1 == -* ]]; then printf 'Usage: %s catalog-directory bundle-resources-directory\n' "$0" >&2 exit 2ficatalogs=("$1"/*.xcstrings)if (( ${#catalogs[@]} == 0 )); then printf 'No String Catalogs found in %s\n' "$1" >&2 exit 1fimkdir -p "$2"destination=$(cd "$2" && pwd)if [[ -e $destination/en-XA.lproj || -L $destination/en-XA.lproj ]]; then printf 'Pseudo resources already exist in %s\n' "$destination" >&2 exit 1fiwork=$(mktemp -d "$destination/.pseudo.XXXXXX")trap 'rm -rf "$work"' EXITmkdir "$work/compiled"for catalog in "${catalogs[@]}"; do prepared="$work/$(basename "$catalog")" "$root/Scripts/parcel-dev.sh" prepare-pseudo-catalog "$catalog" "$prepared" xcrun xcstringstool compile "$prepared" --language en-XA --output-directory "$work/compiled"done[[ -d $work/compiled/en-XA.lproj ]] || { printf 'Compiler produced no pseudo resources.\n' >&2; exit 1; }mv "$work/compiled/en-XA.lproj" "$destination/en-XA.lproj"