Mac 维护
当 Peter 要求进行 Mac 清理、维护或包/仓库刷新时使用。
运行
- Homebrew:
brew update && brew upgrade
~/Projects下的仓库:
for repo in ~/Projects/*/.git; do
dir=${repo:h}
git -C "$dir" status --short --branch
git -C "$dir" pull --ff-only
done
跳过脏仓库,除非 Peter 明确要求处理它们。报告跳过的路径。
- 清空回收站:
osascript -e 'tell application "Finder" to empty trash'
- 以简洁计数结束:
- brew:升级完成 / 已是最新
- 仓库:已拉取 / 已跳过 / 失败
- 回收站:已清空 / 失败