#!/usr/bin/env bash
# Builds or runs Arena Tracker in production mode (optimised release build, no console window),
# with the Windows toolchain like scripts/win. Debug builds are unoptimised and too slow to judge
# smoothness (issue #17): use this one to use the app or measure it.
set -euo pipefail

usage() {
    echo "Usage : scripts/prod <build|run> [arguments cargo...]" >&2
    exit 2
}

[ $# -ge 1 ] || usage
case "$1" in
    build | run) ;;
    *) usage ;;
esac

exec "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/win" "$1" --release "${@:2}"
