2019-05-23 15:20:24 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "cask/download"
|
|
|
|
|
|
|
|
module Cask
|
|
|
|
class Cmd
|
|
|
|
class Cache < AbstractCommand
|
|
|
|
def self.command_name
|
|
|
|
"--cache"
|
|
|
|
end
|
|
|
|
|
|
|
|
def initialize(*)
|
|
|
|
super
|
|
|
|
raise CaskUnspecifiedError if args.empty?
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
casks.each do |cask|
|
2020-06-22 11:29:46 -04:00
|
|
|
puts self.class.cached_location(cask)
|
2019-05-23 15:20:24 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-06-19 10:37:31 -04:00
|
|
|
def self.cached_location(cask)
|
|
|
|
Download.new(cask).downloader.cached_location
|
|
|
|
end
|
|
|
|
|
2019-05-23 15:20:24 +08:00
|
|
|
def self.help
|
|
|
|
"display the file used to cache the Cask"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|