Fix WESP UI after git clone: serve from public/wesp and materialize static.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-32
@@ -1,36 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
# Mirror WESP zootech + admin static UI into site web public/static (1:1 paths).
|
||||
# Sync WESP UI: optional external hub refresh, then materialize public/static.
|
||||
# External source: WESP_STATIC or ../wesp/static (when present).
|
||||
# Fallback: git-tracked apps/web/public/wesp (works after clone without WESP repo).
|
||||
set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
WESP_STATIC="${WESP_STATIC:-$ROOT/../wesp/static}"
|
||||
DEST="$ROOT/apps/web/public/static"
|
||||
ORCH_BOOT="$ROOT/apps/web/public/wesp/js/wesp-orchestrator-boot.js"
|
||||
AUTH_BRIDGE_SRC="$ROOT/apps/web/public/wesp/js/wesp-orchestrator-auth-bridge.js"
|
||||
|
||||
if [ ! -d "$WESP_STATIC" ]; then
|
||||
echo "WESP static not found: $WESP_STATIC" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$DEST"
|
||||
|
||||
# Full mirror: same /static/* and page HTML paths as on the WESP hub.
|
||||
rsync -a --delete \
|
||||
--exclude '.DS_Store' \
|
||||
"$WESP_STATIC/" "$DEST/"
|
||||
|
||||
# Orchestrator-only adapters (never overwritten by hub copy).
|
||||
mkdir -p "$DEST/js"
|
||||
if [ -f "$ORCH_BOOT" ]; then
|
||||
cp "$ORCH_BOOT" "$DEST/js/wesp-orchestrator-boot.js"
|
||||
fi
|
||||
if [ -f "$AUTH_BRIDGE_SRC" ]; then
|
||||
cp "$AUTH_BRIDGE_SRC" "$DEST/js/wesp-orchestrator-auth-bridge.js"
|
||||
fi
|
||||
LOGIN_ADAPTER_SRC="$ROOT/apps/web/public/wesp/js/wesp-orchestrator-login.js"
|
||||
if [ -f "$LOGIN_ADAPTER_SRC" ]; then
|
||||
cp "$LOGIN_ADAPTER_SRC" "$DEST/js/wesp-orchestrator-login.js"
|
||||
fi
|
||||
|
||||
echo "Synced WESP static from $WESP_STATIC -> $DEST"
|
||||
exec bash "$ROOT/scripts/materialize-wesp-static.sh"
|
||||
|
||||
Reference in New Issue
Block a user