#!/bin/bash
# ES-visible entry point for the AAhead shell. Logs arrival, then calls the
# real launcher with a direct (unbuffered) redirect so nothing is lost on a
# fast crash.
D="/roms/ports/aahead"
[ -d "$D" ] || D="$(cd "$(dirname "$0")/aahead" && pwd)"

exec >> "$D/entry.log" 2>&1
echo "==== entry $(date) ===="
echo "directory resolved: $D"
bash "$D/launch.sh"
echo "launch.sh returned rc=$?"
echo "==== entry end $(date) ===="
