`WOW_DATA` names the install, defaulting to the TurtleWoW one, and `WOW_HOST` overrides the realm for a single run without touching `benilla-config/config.toml`. Builds the release binary first if it is not there, then execs it, so the run line is one command.
33 lines
1.1 KiB
Bash
Executable File
33 lines
1.1 KiB
Bash
Executable File
#!/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" "$@"
|