diff --git a/run.sh b/run.sh new file mode 100755 index 00000000..c05b82b5 --- /dev/null +++ b/run.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Launch the built benilla client against the local TurtleWoW install. +# +# ./run.sh # release build, TurtleWoW data, saved settings +# ./run.sh --release # (same; argument is passed through to the client) +# WOW_DATA=/path/to/Data ./run.sh +# WOW_HOST=logon.turtle-wow.org ./run.sh +# +# The realm comes from benilla-config/config.toml (or the Realmlist button on the login +# screen). Set WOW_HOST to override it for this run without touching the file; set WOW_USER +# and WOW_PASS to skip the login screen. +set -euo pipefail + +root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "$root" + +# The game data folder. Defaults to the TurtleWoW install; override with WOW_DATA. +: "${WOW_DATA:=$HOME/Documents/TurtleWoW/Data}" +export WOW_DATA +if [ ! -d "$WOW_DATA" ]; then + echo "run: no Data folder at $WOW_DATA — set WOW_DATA=/path/to/WoW/Data" >&2 + exit 1 +fi + +bin="$root/target/release/benilla" +if [ ! -x "$bin" ]; then + echo "run: $bin is missing; building (release)…" + cargo build --release -p benilla +fi + +echo "run: $bin (data: $WOW_DATA${WOW_HOST:+, realm: $WOW_HOST})" +exec "$bin" "$@"