fix(v3.2.0): 审查修复 3 Blocker

1. $TOTAL_PHASES 7→8 (Phase 8 OTA 后 GUI 进度条溢出)
2. OTA config.json 只在不存在时写入 (保留 lastCheck 冷却)
3. remote URL 比对从硬编码改为动态 $expectedBase

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
bookworm 2026-04-28 00:28:55 +08:00
parent fa287ae27d
commit df3a105f92
2 changed files with 8 additions and 4 deletions

Binary file not shown.

View File

@ -80,7 +80,7 @@ $GitUrl = "https://code.letcareme.com/bookworm/bookworm-smart-assistant.gi
$BootUrl = "https://code.letcareme.com/bookworm/bookworm-boot.git"
$BootDir = Join-Path $ScriptDir "bookworm-boot"
$SecretsEnc = Join-Path $BootDir "secrets.enc"
$TOTAL_PHASES = 7
$TOTAL_PHASES = 8
# ─── GUI 初始化 ─────────────────────────────────────
Add-Type -AssemblyName System.Windows.Forms
@ -1621,7 +1621,7 @@ if (Test-Path (Join-Path $ClaudeDir ".git")) {
try {
$currentRemote = (& git -C $ClaudeDir remote get-url origin 2>$null) -replace '\.git$', ''
$expectedBase = ($GitUrl -replace '\.git$', '')
if ($currentRemote -and $currentRemote -notmatch 'bookworm-smart-assistant') {
if ($currentRemote -and $currentRemote -ne $expectedBase) {
Log-Warn "配置仓库 remote 指向旧源: $currentRemote, 切换到 $GitUrl"
& git -C $ClaudeDir remote set-url origin $GitUrl 2>$null
Log-OK "remote 已切换到 bookworm-smart-assistant"
@ -2632,8 +2632,12 @@ try {
channel = 'stable'
} | ConvertTo-Json -Depth 4
$otaConfigPath = Join-Path $otaDir 'config.json'
[IO.File]::WriteAllText($otaConfigPath, $otaConfig, [Text.UTF8Encoding]::new($false))
Log-OK "8c OTA 配置已写入"
if (-not (Test-Path $otaConfigPath)) {
[IO.File]::WriteAllText($otaConfigPath, $otaConfig, [Text.UTF8Encoding]::new($false))
Log-OK "8c OTA 配置已写入"
} else {
Log-OK "8c OTA 配置已存在, 保留 lastCheck"
}
# 8d: 复制 bw-ota.ps1 (从安装器同目录或 BootDir)
$otaScript = Join-Path $otaDir 'bw-ota.ps1'