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:已升級 / 已是最新
- 儲存庫:已拉取 / 已跳過 / 失敗
- 垃圾桶:已清空 / 失敗