aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/--cellar.rb
blob: e1c641ce1b36af845c6cc99e4ce75ef2f67a411b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#:  * `--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
  def __cellar
    if ARGV.named.empty?
      puts HOMEBREW_CELLAR
    else
      puts ARGV.resolved_formulae.map(&:rack)
    end
  end
end