Skip to content
Snippets Groups Projects
Commit ac6ee129 authored by Alex Dunn's avatar Alex Dunn Committed by Mike McQuaid
Browse files

cmd/install: check time of last update if FormulaUnavailableError


Closes Homebrew/homebrew#40035.

Signed-off-by: default avatarMike McQuaid <mike@mikemcquaid.com>
parent dfbc2df0
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,16 @@ module Homebrew
puts_columns(search_formulae(query))
puts "Searching taps..."
puts_columns(search_taps(query))
# If they haven't updated in 48 hours (172800 seconds), that
# might explain the error
master = HOMEBREW_REPOSITORY.join(".git", "refs", "heads", "master")
if master.exist? && (Time.now.to_i - File.mtime(master).to_i) > 172800
ohai "You haven't updated Homebrew in a while."
puts <<-EOS.undent
A formula for #{e.name} might have been added recently: run `brew update` to make sure everything's up-to-date!
EOS
end
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment