#!/bin/sh

APP_DIR="/usr/lib/paranoya"

if [ ! -f "${APP_DIR}/paranoya.py" ]; then
    echo "Error: Paranoya installation is incomplete." >&2
    exit 1
fi

# Paranoya may execute upgrader.py using a relative path.
# Running from the application directory keeps that behavior
# compatible with the original source tree.

cd "${APP_DIR}" || exit 1

exec /usr/bin/python3 \
    "${APP_DIR}/paranoya.py" \
    "$@"
