#!/bin/sh
# JA2 Native Port installer entry point (Linux x86_64 / aarch64). Unofficial fan project: no game data is
# included or downloaded; it installs from your own copy of Jagged Alliance 2. See README.md and docs/user-guide.md.
# Needs python3 (3.8+). 7-Zip (for the .7z mod archive) and innoextract (for a GOG setup .exe) are checked by the
# installer before it starts copying. --help lists the options.
here=$(cd "$(dirname "$0")" && pwd)
if ! command -v python3 >/dev/null 2>&1; then
  echo "ja2n-install: python3 (3.8 or newer) is required: apt install python3 | dnf install python3 | pacman -S python" >&2
  exit 3
fi
if ! python3 -c 'import sys; sys.exit(sys.version_info < (3, 8))' 2>/dev/null; then
  echo "ja2n-install: python3 is too old ($(python3 -V 2>&1)); 3.8 or newer is required" >&2
  exit 3
fi
exec python3 "$here/lib/ja2n_install.py" "$@"
