# 提交并推送 1.6.0 $ErrorActionPreference = "Continue" $git = "C:\Program Files\Git\bin\git.exe" $root = "C:\Users\shu\Desktop\deepseekagent\LanRemote" Set-Location $root Write-Host "===== 1. 暂存 =====" -ForegroundColor Cyan & $git add -A 2>&1 | Out-Null $files = @(& $git -c core.quotepath=false diff --cached --name-only | Where-Object { $_ -and $_.Trim() -ne "" }) Write-Host " 改动: $($files.Count) 个" $files | Select-Object -First 20 | ForEach-Object { Write-Host " $_" } Write-Host "" Write-Host "===== 2. 确认没有大文件 =====" -ForegroundColor Cyan $big = foreach ($f in $files) { $p = Join-Path $root ($f -replace '/','\') if (Test-Path -LiteralPath $p -PathType Leaf) { $len = (Get-Item -LiteralPath $p).Length if ($len -gt 500KB) { [pscustomobject]@{ N = $f; MB = [math]::Round($len/1MB,2) } } } } if ($big) { $big | ForEach-Object { Write-Host " ⚠ $($_.MB) MB $($_.N)" -ForegroundColor Yellow } } else { Write-Host " ✓ 没有超过 500KB 的" -ForegroundColor Green } Write-Host "" Write-Host "===== 3. 提交 =====" -ForegroundColor Cyan $msg = @" 1.6.0:重写 README,面向老师 / 电教 / 开发者 / 普通用户 README - 原来的 README 是开发者视角(在解释"我为什么没做某功能"), 而且通篇 AI 腔。这次按用户视角重写,讲怎么用。 - 开头就分流:老师 / 电教 / 开发者 / 普通用户,各看各的 - 定位改成"教室电脑手表遥控",主场景是老师上课管教室那台电脑 - 加了电教专用一节:机房同传部署、脚本批量推、网络规划、权限收口 - 加了开发者一节:三端怎么编译、怎么跑测试、怎么打包 - 加了通信协议一节 - 常见问题、排错顺序、错误对照表都补全 版本号 - 1.5.0 -> 1.6.0(versionCode 107) - 顺手写了通用的版本升级脚本 _build/bump_version_generic.py, 以后升版本一条命令就行,不用手改十几个文件 "@ & $git commit -q -m $msg 2>&1 | Out-Null Write-Host " exit=$LASTEXITCODE" & $git log --oneline 2>&1 | Select-Object -First 2 | ForEach-Object { Write-Host " $_" } Write-Host "" Write-Host "===== 4. 推送 =====" -ForegroundColor Cyan $env:GIT_SSH_COMMAND = "`"C:\Program Files\Git\usr\bin\ssh.exe`"" & $git push origin main 2>&1 | Select-Object -Last 5 | ForEach-Object { Write-Host " $_" } Write-Host " exit=$LASTEXITCODE"