#!/usr/bin/env bash # Copies the Firebase config (both Android clients, se.hagstedt.kvitt and se.hagstedt.kvitt.debug) from # infra/secrets/google-services.json to android/app/google-services.json in this checkout. Both are git-ignored. # Usage: infra/dev/copy-google-services.sh [source checkout] (default: this checkout; in a worktree, pass the main checkout) set -euo pipefail # shellcheck source=lib.sh . "$(dirname "$0")/lib.sh" src_root="${1:-$repo_root}" src="$src_root/infra/secrets/google-services.json" dst="$repo_root/android/app/google-services.json" [[ -f "$src" ]] || { echo "copy-google-services.sh: $src not found (created by the M2c-dev Firebase setup)." >&2; exit 1; } git -C "$repo_root" check-ignore -q "android/app/google-services.json" || { echo "copy-google-services.sh: android/app/google-services.json is not git-ignored; refusing to copy." >&2 exit 1 } mkdir -p "$(dirname "$dst")" cp "$src" "$dst" chmod 600 "$dst" echo "Copied google-services.json to $dst"