Skip to content

Instantly share code, notes, and snippets.

@codeslinger
Created June 3, 2012 13:40
Show Gist options
  • Save codeslinger/2863538 to your computer and use it in GitHub Desktop.
Save codeslinger/2863538 to your computer and use it in GitHub Desktop.
def check_for_outdated_homebrew
HOMEBREW_REPOSITORY.cd do
timestamp = if File.directory? ".git"
`git log -1 --format="%ct" HEAD`.to_i
else
(HOMEBREW_REPOSITORY/"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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment