From d06a6e47d7da4930194065853ca50f3dbd557485 Mon Sep 17 00:00:00 2001 From: "Oliver Surke (Gitea)" Date: Mon, 11 May 2026 21:22:27 +0200 Subject: [PATCH] fix: soft-fail brew bundle install; update .gitignore lib/brew.sh: brew bundle exits non-zero when any single package fails (network error, cask version mismatch, missing tap, etc.). Previously this killed the entire ssr restore via set -euo pipefail before mackup / defaults / prefs had a chance to run. Capture the exit code, emit a clear warning, and continue. The user can rerun the manual command shown in the warning. .gitignore: Replace minimal gitignore with the comprehensive macOS + Cursor + VSCode template generated by toptal gitignore.io. Preserve the original ssr- specific custom rules (.local/, .config/, *.log, *.plist.local) in the custom section at the bottom. Co-authored-by: Cursor --- .gitignore | 8 ++++++++ lib/brew.sh | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 315d92e..1215ae7 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,11 @@ Temporary Items # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) +# ssr — user-local state and config (never commit) +.local/ +.config/ +*.log + +# User-rendered launchd plist (template lives in launchd/) +*.plist.local + diff --git a/lib/brew.sh b/lib/brew.sh index 69532ad..227cfee 100644 --- a/lib/brew.sh +++ b/lib/brew.sh @@ -66,5 +66,16 @@ ssr::brew::restore() { local brewfile="$1" [[ -f "$brewfile" ]] || ssr::die "Brewfile not found: $brewfile" ssr::log "brew bundle install ← $brewfile" - brew bundle install --file="$brewfile" --verbose + # brew bundle exits non-zero when individual packages fail (network errors, + # missing tap, cask version mismatch, etc.). We soft-fail here so the rest + # of ssr restore (mackup, defaults, prefs) still runs. The user can rerun + # `brew bundle install --file="$brewfile"` manually for failed entries. + local rc=0 + brew bundle install --file="$brewfile" --verbose || rc=$? + if [[ $rc -ne 0 ]]; then + ssr::warn "brew bundle install finished with errors (rc=$rc) — some packages were not installed." + ssr::warn "Rerun manually: brew bundle install --file=\"$brewfile\"" + else + ssr::ok "brew bundle install completed successfully." + fi }