Files
flutter_opencode_client/auto_report.sh
wuqiyang312 9bd3734238
Some checks failed
flutter analysis / check (push) Has been cancelled
docs: Update documentation for OpenCode Client
- Update site title and description
- Add OpenCode integration documentation
- Update installation guides with custom build instructions
- Update quick start guides
- Update building documentation
- Add build status reporting scripts
- Update Chinese translations
2026-04-03 20:06:30 +08:00

63 lines
1.7 KiB
Bash
Executable File

#!/bin/bash
# OpenCode Client 自动汇报脚本 - 供主会话读取
STATUS_DIR="/root/.openclaw/workspace/flutter_opencode_client/.build_status"
mkdir -p $STATUS_DIR
REPORT_FILE="$STATUS_DIR/report_$(date +%s).txt"
LATEST_FILE="$STATUS_DIR/latest.txt"
GIT_REPO="/root/.openclaw/workspace/flutter_opencode_client"
APK_OUTPUT="$GIT_REPO/build/app/outputs/flutter-apk/app-release.apk"
# 生成报告
{
echo "$(date '+%Y-%m-%d %H:%M:%S')"
echo ""
# 检查 Flutter SDK
if [ -f "/opt/flutter/bin/cache/dart-sdk/bin/dart" ]; then
echo "✅ Flutter SDK: 已就绪"
export PATH="$PATH:/opt/flutter/bin"
else
echo "⏳ Flutter SDK: 安装中..."
if [ -f "/tmp/flutter_linux.tar.xz" ]; then
SIZE=$(ls -lh /tmp/flutter_linux.tar.xz | awk '{print $5}')
echo " 下载进度: $SIZE / 731MB"
fi
fi
# 检查构建状态
if [ -f "$APK_OUTPUT" ]; then
APK_SIZE=$(ls -lh $APK_OUTPUT | awk '{print $5}')
echo "✅ APK: 构建成功 ($APK_SIZE)"
else
echo "⏳ APK: 构建中或等待 Flutter"
fi
# 检查活跃进程
if pgrep -f "flutter.*build" >/dev/null; then
echo "🔨 状态: flutter build 运行中"
elif pgrep -f "curl.*flutter" >/dev/null; then
echo "⬇️ 状态: Flutter SDK 下载中"
else
echo "⏸️ 状态: 等待中"
fi
# Git 状态
cd $GIT_REPO 2>/dev/null || true
COMMITS=$(git rev-list --count opencode/main 2>/dev/null || echo "0")
echo "📤 Git: $COMMITS commits"
echo ""
echo "⏰ 下次汇报: $(date -d '+20 minutes' '+%H:%M')"
} > $REPORT_FILE
# 更新最新报告链接
cp $REPORT_FILE $LATEST_FILE
# 输出到日志(便于调试)
cat $REPORT_FILE >> /tmp/build_report.log
# 保留最近10份报告
ls -t $STATUS_DIR/report_*.txt 2>/dev/null | tail -n +11 | xargs rm -f 2>/dev/null