Last active
August 29, 2015 14:26
-
-
Save awaxa/eed53c5850581746df8c to your computer and use it in GitHub Desktop.
This file contains 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
if File.exist?('/usr/local/.git') | |
Facter.add(:homebrew_stale) do | |
confine :kernel => 'Darwin' | |
setcode do | |
parse_head_time = 'git --git-dir=/usr/local/.git log --pretty=format:%ct' | |
head_time = Facter::Core::Execution.exec(parse_head_time).to_i | |
now = Time.now.to_i | |
age = now - head_time | |
age > 60*60*24 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment