#!/bin/sh
# System launcher installed as /usr/bin/hook by the .deb package.
# It points Hook at its read-only install tree under /opt/hook and reuses the
# same XDG data model as the AppImage: application assets are read from
# /opt/hook, mutable user data lives under ~/.local/share/hook and config under
# ~/.config/hook. hook_paths.c switches into that mode when APPIMAGE is set, so
# we export it (its value is only tested for non-emptiness) along with APPDIR.
APPDIR=/opt/hook
export APPDIR
APPIMAGE="$APPDIR/bin/hook"
export APPIMAGE
# Prefer the bundled libraries staged by packaging/bundle-libs.sh so the package
# does not depend on libgit2 / allegro / etc. being installed on the host.
LD_LIBRARY_PATH="$APPDIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH
exec "$APPDIR/bin/hook" "$@"
