#! /usr/bin/env bash

# make sure errors in sourced scripts will cause this script to stop
set -e

this_dir="$(readlink -f "$(dirname "$0")")"

PAGEEDIT_EXTRA_ROOT="$this_dir/usr/share/pageedit"
export PAGEEDIT_EXTRA_ROOT
echo "${PAGEEDIT_EXTRA_ROOT}"

# LD_LIBRARY_PATH="$this_dir/usr/lib:$LD_LIBRARY_PATH"
# export LD_LIBRARY_PATH
# echo "$LD_LIBRARY_PATH"

source "$this_dir"/apprun-hooks/"linuxdeploy-plugin-qt-hook.sh"

LD_LIBRARY_PATH="$this_dir/usr/lib:$LD_LIBRARY_PATH" exec "$this_dir"/AppRun.wrapped "$@"
