#!/bin/sh
# Entry point of the AfterAPro AppImage.
#
# The AppImage runtime exports APPDIR before running this script; the fallback
# to our own location is for an extracted AppDir run by hand. The libraries
# bundle-libs.sh staged in usr/lib go ahead of the host's. The program finds
# its data/ directory next to its own executable (apro_paths_resource), so
# usr/bin/data travels with it and no working directory needs setting.
HERE=$(dirname "$(readlink -f "$0")")
APPDIR=${APPDIR:-$HERE}
export APPDIR
export LD_LIBRARY_PATH="$APPDIR/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
exec "$APPDIR/usr/bin/afterapro" "$@"
