2019-05-23 15:20:24 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require "cask/download"
|
|
|
|
|
|
|
|
module Cask
|
|
|
|
class Cmd
|
|
|
|
class Cache < AbstractCommand
|
2020-08-01 02:30:46 +02:00
|
|
|
def self.min_named
|
|
|
|
:cask
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.description
|
|
|
|
"Display the file used to cache a <cask>."
|
2019-05-23 15:20:24 +08:00
|
|
|
end
|
|
|
|
|
2020-08-01 02:30:46 +02:00
|
|
|
def self.command_name
|
|
|
|
"--cache"
|
2019-05-23 15:20:24 +08:00
|
|
|
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
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|