Mac Maintenance
Attribution: Sourced from steipete/agent-scripts by Peter Steinberger.
Use when asked for Mac cleanup, maintenance, or package/repo refresh.
Run
1. Homebrew update
brew update && brew upgrade
2. Pull repos
for repo in ~/Projects/*/.git; do
dir=${repo:h}
git -C "$dir" status --short --branch
git -C "$dir" pull --ff-only
done
Skip dirty repos unless explicitly asked to handle them. Report skipped paths.
3. Empty Trash (macOS)
osascript -e 'tell application "Finder" to empty trash'
Summary
Finish with terse counts:
- brew:
N packages upgraded/already current - repos:
N pulled/N skipped (dirty)/N failed - trash:
emptied/failed