#!/usr/bin/env bash

SCL_SOURCE=$(command -v scl_source)
# Source in the custom environment
# shellcheck source=/dev/null
[[ "${SCL_SOURCE}" ]] && source "${SCL_SOURCE}" enable ondemand &> /dev/null

ROOT_DIR="$(dirname "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
NAME=$(basename "$0")

exec \
  /usr/bin/env ruby \
    -I"${ROOT_DIR}/lib" \
    -rood_portal_generator \
    -e "OodPortalGenerator::Application.start('$NAME')" \
    -- "${@}"
