Created
June 3, 2012 13:40
-
-
Save codeslinger/2863538 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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