2013-05-23 09:21:33 -07:00

18 lines
484 B
Ruby

module Homebrew extend self
def log
if ARGV.named.empty?
cd HOMEBREW_REPOSITORY
exec "git", "log", *ARGV.options_only
else
begin
path = ARGV.formulae.first.path.realpath
rescue FormulaUnavailableError
# Maybe the formula was deleted
path = HOMEBREW_REPOSITORY/"Library/Formula/#{ARGV.named.first}.rb"
end
cd path.dirname # supports taps
exec "git", "log", *ARGV.options_only + ["--", path]
end
end
end