Files
LINUX-AETHERFORGE/scripts/sync-webroot.sh
drjones 3678b199d0
Some checks failed
Test / test (push) Has been cancelled
Initial commit: AetherForge Linux (forge-mesh) v0.1.0-dev
2026-07-04 09:31:23 +00:00

17 lines
484 B
Bash
Executable File

#!/usr/bin/env bash
# Copy Vite build output into cmd/server/webroot for go:embed.
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
DIST="$ROOT/web/dist"
WEBROOT="$ROOT/cmd/server/webroot"
if [[ ! -f "$DIST/index.html" ]]; then
echo "ERROR: $DIST/index.html missing — run: cd web && npm run build" >&2
exit 1
fi
rm -rf "$WEBROOT"
mkdir -p "$WEBROOT"
cp -a "$DIST"/. "$WEBROOT/"
echo "Synced web/dist -> cmd/server/webroot ($(find "$WEBROOT" -type f | wc -l) files)"