#!/usr/bin/env bash
set -euo pipefail
root=$(cd "$(dirname "$0")/.." && pwd)
if [[ "${1:-}" == turn-inspect ]]; then shift; exec python3 "$root/scripts/turn-inspect.py" "$@"; fi
if [[ "${1:-}" == find-google-audience ]]; then exec python3 "$root/scripts/find-google-audience.py" --production; fi
if [[ "${1:-}" == social-login-inspect ]]; then exec python3 "$root/scripts/social-login-inspect.py"; fi
if [[ "${1:-}" == audit-config ]]; then shift; exec python3 "$root/scripts/audit-config.py" "$@"; fi
if [[ "${1:-}" == audit-backup-repair ]]; then shift; exec python3 "$root/scripts/audit-backup-repair.py" "$@"; fi
if [[ "${1:-}" == audit-inspect ]]; then exec python3 "$root/scripts/audit-inspect.py"; fi
if [[ "${1:-}" == round2-verify ]]; then shift; exec python3 "$root/scripts/round2-verify.py" "$@"; fi
if [[ "${1:-}" == round2-turn ]]; then shift; exec python3 "$root/scripts/round2-turn.py" "$@"; fi
if [[ "${1:-}" == round2-php ]]; then shift; exec python3 "$root/scripts/round2-php.py" "$@"; fi
if [[ "${1:-}" == round2-inspect ]]; then exec python3 "$root/scripts/round2-inspect.py"; fi
if [[ "${1:-}" == check ]]; then shift; set -- inspect "$@"; fi
if [[ "${1:-}" == mobile ]]; then
  shift
  exec python3 "$root/scripts/mobile-cutover.py" "$@"
fi
exec python3 "$root/scripts/deploy.py" "$@"
