#!/usr/bin/env bash # Atlas CLI wrapper — celestial bodies and stations in systems.db. # # Usage: # tooling/atlas stats # tooling/atlas show-system "GJ 15A" # tooling/atlas list-bodies --system "GJ 15A" # tooling/atlas populate --dry-run # # Builds on first run if binary doesn't exist. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" BIN="$ROOT_DIR/server/target/debug/atlas" # Build if needed if [ ! -f "$BIN" ]; then echo "Building atlas..." >&2 (cd "$ROOT_DIR/server" && cargo build --bin atlas 2>&1 | tail -3) >&2 fi exec "$BIN" "$@"