Init
This commit is contained in:
41
packaging/pristontale-eu
Executable file
41
packaging/pristontale-eu
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
set -eu
|
||||
|
||||
app_home=@PTLINUX_APP_ROOT@
|
||||
install_directory=@PTLINUX_INSTALL_DIR@
|
||||
python_bin="${PTLINUX_PYTHON:-python3}"
|
||||
|
||||
export PTLINUX_INSTALL_DIR="${install_directory}"
|
||||
export PTLINUX_APP_HOME="${app_home}"
|
||||
|
||||
release_root=""
|
||||
for candidate in "${app_home}/current" "${app_home}/previous" "${app_home}"
|
||||
do
|
||||
if [ ! -d "${candidate}/ptlinux" ]
|
||||
then
|
||||
continue
|
||||
fi
|
||||
if "$python_bin" -I -c \
|
||||
'import sys; sys.path.insert(0, sys.argv[1]); import ptlinux, ptlinux.cli' \
|
||||
"${candidate}" >/dev/null 2>&1
|
||||
then
|
||||
release_root="${candidate}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -z "${release_root}" ]
|
||||
then
|
||||
printf '%s\n' "PristonTale EU Linux application files are missing or invalid: ${app_home}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "${PYTHONPATH:-}" ]
|
||||
then
|
||||
export PYTHONPATH="${release_root}:${PYTHONPATH}"
|
||||
else
|
||||
export PYTHONPATH="${release_root}"
|
||||
fi
|
||||
|
||||
exec "$python_bin" -m ptlinux "$@"
|
||||
Reference in New Issue
Block a user