feat: add command for backup/recover brewfile

Signed-off-by: Li Tang <iamtangli42@gmail.com>
This commit is contained in:
2026-05-25 15:44:49 +08:00
parent 5f9534ad00
commit d72cb9fdf1
3 changed files with 156 additions and 15 deletions

28
brewfiles/README.md Normal file
View File

@@ -0,0 +1,28 @@
# Per-Machine Brewfiles
Each Mac keeps its own Homebrew bundle under `brewfiles/<hostname>/Brewfile`, where `<hostname>` is the short hostname (`hostname -s`, e.g. `stardewvalley`).
## Commands
```bash
# Dump only (frequent updates)
./setup.sh brew-backup
# Install packages for this machine
./setup.sh brew-install
# Full backup still includes brew-backup
./setup.sh backup
```
## New machine / full recover
`./setup.sh full-recover` runs `brew-install` automatically when a Brewfile exists for the current hostname.
## Hostname changed?
Point at another machine's Brewfile:
```bash
BREWFILE_HOST=other-mac ./setup.sh brew-install
```