scense_runtime/build.sh
2026-08-29 21:10:24 +08:00

22 lines
1.3 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# runtime 模块 build 脚本:链接 wwwroot 到宿主 scense 应用(部署目标 /d/scense/scense_app
# 模块不独立部署;本脚本仅负责把模块前端文件链接进宿主 wwwroot。
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MOD=runtime
DEPLOY_ROOT=/d/scense/scense_app
if [ -d "$DEPLOY_ROOT/wwwroot" ]; then
mkdir -p "$DEPLOY_ROOT/wwwroot/$MOD/api"
ln -sf "$SCRIPT_DIR/wwwroot/runtime.js" "$DEPLOY_ROOT/wwwroot/$MOD/runtime.js"
ln -sf "$SCRIPT_DIR/wwwroot/play.html" "$DEPLOY_ROOT/wwwroot/$MOD/play.html"
ln -sf "$SCRIPT_DIR/wwwroot/index.ui" "$DEPLOY_ROOT/wwwroot/$MOD/index.ui"
ln -sf "$SCRIPT_DIR/wwwroot/api/load_world.dspy" "$DEPLOY_ROOT/wwwroot/$MOD/api/load_world.dspy"
ln -sf "$SCRIPT_DIR/wwwroot/api/runtime_status.dspy" "$DEPLOY_ROOT/wwwroot/$MOD/api/runtime_status.dspy"
ln -sf "$SCRIPT_DIR/wwwroot/api/runtime_event.dspy" "$DEPLOY_ROOT/wwwroot/$MOD/api/runtime_event.dspy"
ln -sf "$SCRIPT_DIR/wwwroot/api/runtime_control.dspy" "$DEPLOY_ROOT/wwwroot/$MOD/api/runtime_control.dspy"
echo "[build.sh] runtime wwwroot linked -> $DEPLOY_ROOT/wwwroot/$MOD"
else
echo "[build.sh] WARN: $DEPLOY_ROOT/wwwroot 不存在,跳过链接(本地开发工作空间可忽略)"
fi