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 }