- Hugo site (site/): EN/ES intro + legal (generated from docs/legal), an
ES/EN About page from docs/{que-es-tane,what-is-tane}.md, seed-green theme,
responsive header, store-badge placeholders, multi-stage Hugo->nginx image.
- Golden screenshot harness (test/screenshots/): en,es,fr,de,pt,ja + RTL demo,
real fonts via DejaVu Sans + FontManifest; skip-by-default tag so CI stays
green. collect_screenshots.sh feeds site/ and fastlane phoneScreenshots.
- Drop editorial notes from the public explainer.
54 lines
2.1 KiB
Bash
Executable file
54 lines
2.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Copies the localized golden screenshots into the two places that consume them:
|
|
# 1. the Hugo landing site (site/assets/screenshots/<locale>/)
|
|
# 2. the Play Store metadata (fastlane/metadata/android/<play-locale>/images/phoneScreenshots/)
|
|
#
|
|
# Regenerate the PNGs first:
|
|
# flutter test --update-goldens --tags screenshots test/screenshots/screenshots_test.dart
|
|
# then run this from apps/app_seeds/:
|
|
# tool/collect_screenshots.sh
|
|
set -euo pipefail
|
|
|
|
here="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # apps/app_seeds
|
|
repo_root="$(cd "$here/../.." && pwd)"
|
|
goldens="$here/test/screenshots/goldens"
|
|
site_dir="$repo_root/site/assets/screenshots"
|
|
fastlane_dir="$here/fastlane/metadata/android"
|
|
|
|
if [[ ! -d "$goldens" ]]; then
|
|
echo "No goldens at $goldens — run the screenshots test with --update-goldens first." >&2
|
|
exit 1
|
|
fi
|
|
|
|
# App locale (golden dir) -> Play Store locale (fastlane dir). 'rtl' is a layout
|
|
# demo only (not a real locale) and goes to the site, not the stores.
|
|
declare -A play_locale=(
|
|
[en]=en-US [es]=es-ES [fr]=fr-FR [de]=de-DE [pt]=pt-PT [ja]=ja-JP
|
|
)
|
|
|
|
for dir in "$goldens"/*/; do
|
|
locale="$(basename "$dir")"
|
|
|
|
# 1) Landing site: every locale, including the RTL demo.
|
|
mkdir -p "$site_dir/$locale"
|
|
cp "$dir"*.png "$site_dir/$locale/"
|
|
|
|
# 2) Play Store: only locales that ALREADY have text metadata (a title.txt).
|
|
# A locale dir with images but no store text is invalid for `fastlane supply`,
|
|
# so we don't create image-only locales — add the text first, then it's picked up.
|
|
play="${play_locale[$locale]:-}"
|
|
if [[ -n "$play" && -f "$fastlane_dir/$play/title.txt" ]]; then
|
|
shots="$fastlane_dir/$play/images/phoneScreenshots"
|
|
mkdir -p "$shots"
|
|
# Number them so the store shows them in a deliberate order.
|
|
i=1
|
|
for name in home inventory market calendar detail; do
|
|
[[ -f "$dir$name.png" ]] && cp "$dir$name.png" "$shots/$i.png" && i=$((i + 1))
|
|
done
|
|
echo " store: $play ($((i - 1)) shots)"
|
|
fi
|
|
echo "site: $locale"
|
|
done
|
|
|
|
echo "Done. To add a Play locale beyond en-US/es-ES, create its title/short/full"
|
|
echo "description text under fastlane/metadata/android/<locale>/ first, then re-run."
|