#!/bin/bash
set -euo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"

# Use this Ruby's Bundler, not the stale Ruby 2.7 bundle executable.
# Resolve only this application's gems, excluding unrelated GitLab gems.
if ! ruby -rbundler/setup -e ''; then
  echo 'Install Ruby dependencies with a Bundler matching the current Ruby.' >&2
  exit 1
fi

# This stylesheet uses Tailwind v3; v4 no longer ships this CLI.
npx --yes tailwindcss@3.4.17 -i theme/css/tailwind.css -o tailwind.css -c tailwind.config.js

exec ruby -rbundler/setup -e 'load Gem.bin_path("gollum", "gollum")' -- \
  --allow-uploads=dir --template-dir=templates --h1-title --css --adapter rugged --no-edit

