aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/--cache.rb
blob: 2c407cefe0bf70e4adad5553dbc0fdd8b99c49d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#:  * `--cache`:
#:    Display Homebrew's download cache. See also `HOMEBREW_CACHE`.
#:
#:  * `--cache` <formula>:
#:    Display the file or directory used to cache <formula>.

require "cmd/fetch"

module Homebrew
  module_function

  def __cache
    if ARGV.named.empty?
      puts HOMEBREW_CACHE
    else
      ARGV.formulae.each do |f|
        if fetch_bottle?(f)
          puts f.bottle.cached_download
        else
          puts f.cached_download
        end
      end
    end
  end
end