#!/bin/bash export PATH="/opt/homebrew/bin:$PATH" cd /Users/ace/palacering/code/apps/palaceexaminer export PORT=4326 export HOST=0.0.0.0 export REPO_ROOT=/Users/ace/palacering LOGDIR="logs" mkdir -p "$LOGDIR" if [ -f "$LOGDIR/astro-out.log" ] && [ "$(stat -f%z "$LOGDIR/astro-out.log" 2>/dev/null || echo 0)" -gt 1048576 ]; then mv "$LOGDIR/astro-out.log" "$LOGDIR/astro-out.$(date +%Y%m%d%H%M%S).log" fi if [ -f "$LOGDIR/astro-err.log" ] && [ "$(stat -f%z "$LOGDIR/astro-err.log" 2>/dev/null || echo 0)" -gt 1048576 ]; then mv "$LOGDIR/astro-err.log" "$LOGDIR/astro-err.$(date +%Y%m%d%H%M%S).log" fi npx astro build >> "$LOGDIR/astro-out.log" 2>> "$LOGDIR/astro-err.log" exec node dist/server/entry.mjs >> "$LOGDIR/astro-out.log" 2>> "$LOGDIR/astro-err.log"