mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00

This is a little code refactoring splited from Homebrew/homebrew#36753 The idea is to eliminate `Formula#path` outside of `formulary.rb`. And I indent to deprecate `Formula#path` method when I reimplement symlink free tap function. Closes Homebrew/homebrew#39313.
15 lines
313 B
Ruby
15 lines
313 B
Ruby
require "formula"
|
|
|
|
module Homebrew
|
|
def log
|
|
if ARGV.named.empty?
|
|
cd HOMEBREW_REPOSITORY
|
|
exec "git", "log", *ARGV.options_only
|
|
else
|
|
path = Formulary.path(ARGV.named.first)
|
|
cd path.dirname # supports taps
|
|
exec "git", "log", *ARGV.options_only + ["--", path]
|
|
end
|
|
end
|
|
end
|