Skip to content
Snippets Groups Projects
Commit 9c5ddb57 authored by Max Howell's avatar Max Howell
Browse files

The doctor checks if you need to `brew update`

Well at least it checks to see if it's been a while since the last one.
parent de30a784
No related branches found
No related tags found
No related merge requests found
......@@ -795,6 +795,22 @@ def check_for_bad_python_symlink
end
end
def check_for_outdated_homebrew
HOMEBREW_PREFIX.cd do
timestamp = if File.directory? ".git"
`git log -1 --format="%ct" HEAD`.to_i
else
(HOMEBREW_PREFIX/"Library").mtime.to_i
end
if Time.now.to_i - timestamp > 60 * 60 * 24 then <<-EOS.undent
Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!
EOS
end
end
end
end # end class Checks
module Homebrew extend self
......
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