#!/usr/bin/env bash # 网页模式:bash scripts/run_web.sh [端口,默认 8080] set -euo pipefail cd "$(dirname "$0")/.." PRESET="${PRESET:-debug}" PORT="${1:-8080}" cmake --build --preset "$PRESET" >/dev/null echo "浏览器打开: http://127.0.0.1:$PORT/ (Ctrl+C 结束)" exec "./build/$PRESET/smart_home" --web --port "$PORT" --data data