cache: integrate brew --cache and cask --cache
This commit is contained in:
parent
72ebd2127f
commit
cf76f6e721
@ -16,10 +16,14 @@ module Cask
|
|||||||
|
|
||||||
def run
|
def run
|
||||||
casks.each do |cask|
|
casks.each do |cask|
|
||||||
puts Download.new(cask).downloader.cached_location
|
puts cached_location(cask)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.cached_location(cask)
|
||||||
|
Download.new(cask).downloader.cached_location
|
||||||
|
end
|
||||||
|
|
||||||
def self.help
|
def self.help
|
||||||
"display the file used to cache the Cask"
|
"display the file used to cache the Cask"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
require "fetch"
|
require "fetch"
|
||||||
require "cli/parser"
|
require "cli/parser"
|
||||||
|
require "cask/cmd"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
module_function
|
module_function
|
||||||
@ -29,13 +30,21 @@ module Homebrew
|
|||||||
if args.no_named?
|
if args.no_named?
|
||||||
puts HOMEBREW_CACHE
|
puts HOMEBREW_CACHE
|
||||||
else
|
else
|
||||||
args.formulae.each do |f|
|
args.formulae_and_casks.each do |formula_or_cask|
|
||||||
if Fetch.fetch_bottle?(f)
|
case formula_or_cask
|
||||||
puts f.bottle.cached_download
|
when Formula
|
||||||
|
formula = formula_or_cask
|
||||||
|
if Fetch.fetch_bottle?(formula)
|
||||||
|
puts formula.bottle.cached_download
|
||||||
else
|
else
|
||||||
puts f.cached_download
|
puts formula.cached_download
|
||||||
|
end
|
||||||
|
when Cask::Cask
|
||||||
|
cask = formula_or_cask
|
||||||
|
puts "cask: #{Cask::Cmd::Cache.cached_location(cask)}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user