#!/bin/bash
# Common setup for iOS dev scripts
# Source this file, don't execute it directly

set -eou pipefail

# Resolve repo root. Prefer git, fall back to jj for non-colocated jj
# workspaces (e.g. workspaces created via `jj workspace add`).
if ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"; then
    :
elif ROOT="$(jj root 2>/dev/null)"; then
    :
else
    echo "error: not in a git or jj working tree" >&2
    exit 1
fi
IOS_SDK_DIR="${ROOT}/sdks/ios"
