Files
clawpanel/scripts/dev.sh
晴天 75e94a7560 chore: 添加开源社区基础设施和项目文档
- 添加 README、LICENSE (MIT)、CONTRIBUTING、CHANGELOG
- 添加 GitHub Issue/PR 模板和 FUNDING 配置
- 添加 CI/CD 工作流(ci.yml + release.yml)
- 添加项目文档页面 (docs/index.html)
- 添加 logo 和社群二维码图片资源
- 添加开发和构建脚本 (dev.sh + build.sh)
- 更新 package-lock.json 依赖
2026-02-28 03:23:39 +08:00

44 lines
1.1 KiB
Bash
Executable File
Raw 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
# ClawPanel 开发模式启动脚本
# 用法: ./scripts/dev.sh [web|tauri]
# web - 仅启动 Vite 前端浏览器调试mock 数据)
# tauri - 启动完整 Tauri 桌面应用(默认)
set -e
cd "$(dirname "$0")/.."
MODE="${1:-tauri}"
# 清理旧进程
cleanup() {
echo "🧹 清理旧进程..."
pkill -f "vite.*clawpanel" 2>/dev/null || true
pkill -f "target/debug/clawpanel" 2>/dev/null || true
lsof -ti:1420 | xargs kill -9 2>/dev/null || true
sleep 0.5
}
cleanup
case "$MODE" in
web)
echo "🌐 启动 Vite 前端开发服务器(浏览器模式)..."
echo " 地址: http://localhost:1420"
echo " 使用 mock 数据,适合调试前端逻辑"
echo ""
npx vite --port 1420
;;
tauri)
echo "🖥️ 启动 Tauri 桌面应用(完整模式)..."
echo " Vite + Rust 后端"
echo ""
npm run tauri dev
;;
*)
echo "用法: $0 [web|tauri]"
echo " web - 仅 Vite 前端(浏览器调试)"
echo " tauri - Tauri 桌面应用(默认)"
exit 1
;;
esac