♻️ refactor(core): 移除 brew-cu 扩展并优化升级流程结构

This commit is contained in:
2026-06-05 19:58:11 +08:00
parent 9b6aa38ac1
commit d82545d492
2 changed files with 13 additions and 20 deletions
+11 -7
View File
@@ -15,7 +15,6 @@
- 执行 `brew update -v` 更新 Homebrew 仓库。
- 执行 `brew doctor` 做健康检查;发现问题时给出警告,但不中断后续流程。
- 检查并安装 `buo/cask-upgrade` tap,保留 GUI 应用升级相关兼容能力。
- 使用 `brew upgrade --formula` 升级命令行工具。
- 使用 `brew upgrade --cask --greedy --force` 强制升级 GUI 应用。
- 当 Cask 升级命令因瞬时下载错误返回失败,但复核确认已无过期 Cask 时,继续执行后续清理。
@@ -160,10 +159,9 @@ BREWUP_DEBUG=1 brewup
1. `brew update -v`
2. `brew doctor`
3. 检查 `buo/cask-upgrade` tap
4. `brew upgrade --formula`
5. `brew upgrade --cask --greedy --force`
6. `brew cleanup --prune=all`
3. `brew upgrade --formula`
4. `brew upgrade --cask --greedy --force`
5. `brew cleanup --prune=all`
## 常见问题
@@ -194,9 +192,15 @@ brewup --width 130
HB_TERMINAL_WIDTH=130 brewup
```
### `brew tap buo/cask-upgrade` 失败
### `Error: can't modify frozen Array`
通常是网络、Homebrew tap 或权限问题。先确认 Homebrew 可正常访问 GitHub 和对应 tap
这是 `buo/cask-upgrade` tap 与新版 Homebrew 的兼容问题。先移除该 tap
```bash
brew untap buo/cask-upgrade
```
GUI 应用升级现在使用 Homebrew 官方的 `brew upgrade --cask --greedy --force`,脚本不再需要 `buo/cask-upgrade`
### `brew doctor` 提示 warning
+2 -13
View File
@@ -90,18 +90,7 @@ separator
printf "\n"
separator
print_header "Step 3: Verifying brew-cu extension for GUI Apps"
if ! brew tap | grep -q "buo/cask-upgrade"; then
echo -e "${YELLOW}Extension 'brew-cu' not found. Installing now...${NC}"
brew tap buo/cask-upgrade
else
echo -e "${GREEN}Extension 'brew-cu' is already active.${NC}"
fi
separator
printf "\n"
separator
print_header "Step 4: Executing comprehensive upgrades (Formulae & Casks)"
print_header "Step 3: Executing comprehensive upgrades (Formulae & Casks)"
echo -e "${NC}"
# 1. 升级命令行工具 (Formulae)
@@ -125,7 +114,7 @@ separator
printf "\n"
separator
print_header "Step 5: Cleaning up old files and caches (brew cleanup --prune=all)"
print_header "Step 4: Cleaning up old files and caches (brew cleanup --prune=all)"
brew cleanup --prune=all
separator
printf "\n"