#!/bin/bash
set -euo pipefail
APP_ROOT="${1:-/home/smaraxam/hyreall.com/me}"
PATCH_ROOT="$(cd "$(dirname "$0")" && pwd)"
mkdir -p "$APP_ROOT/.next"
rm -rf "$APP_ROOT/.next/server"
cp -R "$PATCH_ROOT/.next/server" "$APP_ROOT/.next/server"
touch "$APP_ROOT/tmp/restart.txt"
echo "Applied HyreMe hotfix patch to: $APP_ROOT"
echo "Passenger restart requested via tmp/restart.txt"
