#!/usr/bin/env bash

set -eu

source "$(dirname "$(realpath "${0}")")"/../global-vars.inc.bash
source "${ROOT_PATH}"/bin/verbosity.inc.bash
source "${ROOT_PATH}"/bin/theme.inc.bash

theme-title "Install LeLED staging server for O2Switch"
git fetch && git checkout staging && git pull
composer install --no-dev
php artisan migrate --force
/opt/alt/alt-nodejs22/root/bin/npm install && /opt/alt/alt-nodejs22/root/bin/npm run build
php artisan cache:clear
theme-ok

printf "\n\e[0;32mLeLED staging is installed.\e[0m\n"
