Cheng XU 169ac2d413
cask: add new --cache command
It prints the file used to cache Casks.

This can be used to help users to install casks with their files
downloaded from outside brew.

See #6157.
2019-05-23 15:28:00 +08:00

29 lines
495 B
Ruby

# 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|
puts Download.new(cask).downloader.cached_location
end
end
def self.help
"display the file used to cache the Cask"
end
end
end
end