Skip to content

Commit

Permalink
Merge pull request #17018 from Homebrew/brew_auto_update_exception
Browse files Browse the repository at this point in the history
brew.rb: improve no auto-update exception handling.
  • Loading branch information
MikeMcQuaid authored Apr 4, 2024
2 parents 044e48b + ef19c9f commit 96878e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Library/Homebrew/brew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@

if OS.unsupported_configuration?
$stderr.puts "#{Tty.bold}Do not report this issue: you are running in an unsupported configuration.#{Tty.reset}"
elsif Homebrew::EnvConfig.no_auto_update?
$stderr.puts "#{Tty.bold}You have disabled automatic updates.#{Tty.reset}"
elsif Homebrew::EnvConfig.no_auto_update? &&
(fetch_head = HOMEBREW_REPOSITORY/".git/FETCH_HEAD") &&
(!fetch_head.exist? || (fetch_head.mtime.to_date < Date.today))
$stderr.puts "#{Tty.bold}You have disabled automatic updates and have not updated today.#{Tty.reset}"
$stderr.puts "#{Tty.bold}Do not report this issue until you've run `brew update` and tried again.#{Tty.reset}"
elsif (issues_url = (method_deprecated_error && e.issues_url) || Utils::Backtrace.tap_error_url(e))
$stderr.puts "If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core):"
Expand Down

0 comments on commit 96878e8

Please sign in to comment.