Skip to content

fix(updater): don't treat brew outdated's exit code as failure - #22

Merged
lordgreg merged 1 commit into
masterfrom
fix/brew-outdated-exit-code
Sep 9, 2026
Merged

fix(updater): don't treat brew outdated's exit code as failure#22
lordgreg merged 1 commit into
masterfrom
fix/brew-outdated-exit-code

Conversation

@lordgreg

@lordgreg lordgreg commented Sep 9, 2026

Copy link
Copy Markdown
Owner

brew outdated --json=v2 intentionally exits non-zero when the named formula is outdated (Homebrew.failed = args.named.present? && outdated.present?). This is brew's convention for scripting, not an execution failure, but the updater was bailing out early on any non-success status without ever inspecting stdout - so a real update notification was being reported as "brew update failed" instead.

Extract handle_brew_outdated_output() which now inspects stdout instead of the process exit status: only an empty stdout is treated as a real failure, matching brew's actual failure mode (no output at all).

brew outdated <formula> --json=v2 intentionally exits non-zero when the
named formula is outdated (Homebrew.failed = args.named.present? &&
outdated.present?). This is brew's convention for scripting, not an
execution failure, but the updater was bailing out early on any
non-success status without ever inspecting stdout - so a real update
notification was being reported as "brew update failed" instead.

Extract handle_brew_outdated_output() which now inspects stdout instead
of the process exit status: only an empty stdout is treated as a real
failure, matching brew's actual failure mode (no output at all).
@lordgreg
lordgreg merged commit 4b71a99 into master Sep 9, 2026
4 checks passed
@lordgreg
lordgreg deleted the fix/brew-outdated-exit-code branch September 9, 2026 18:34
@lordgreg

lordgreg commented Sep 9, 2026

Copy link
Copy Markdown
Owner Author

Closes #19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant