#!/usr/bin/env bash
#
# Portable installer, for macOS and Linux.
#
# It only does one thing: find the PHP on this machine and hand the real work to
# install.php, which sits beside it. Pass it the same options:
#
#     ./portable/install.sh --db-name=solar_crm
#
set -euo pipefail

here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

if ! command -v php >/dev/null 2>&1; then
    echo "php was not found on PATH. Install PHP 8.3 or newer, then run this again." >&2
    exit 1
fi

exec php "${here}/install.php" "$@"
