brew/Library/Homebrew/cmd/--cellar.rb

20 lines
515 B
Ruby
Raw Normal View History

#: * `--cellar`:
#: Display Homebrew's Cellar path. *Default:* `$(brew --prefix)/Cellar`, or if
#: that directory doesn't exist, `$(brew --repository)/Cellar`.
#:
#: * `--cellar` <formula>:
#: Display the location in the cellar where <formula> would be installed,
#: without any sort of versioned directory as the last path.
module Homebrew
2016-09-26 01:44:51 +02:00
module_function
def __cellar
if ARGV.named.empty?
puts HOMEBREW_CELLAR
else
2015-05-17 20:14:26 +08:00
puts ARGV.resolved_formulae.map(&:rack)
end
end
end