aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib/hbc/cli/fetch.rb
diff options
context:
space:
mode:
authorAnastasiaSulyagina2016-08-18 22:11:42 +0300
committerAnastasiaSulyagina2016-08-19 14:50:14 +0300
commite81f4ab7deeb40308f240be5ea00091fc8786d7a (patch)
treeb5418f9149de71c0f05f90cb2b39ab47f46e27b4 /Library/Homebrew/cask/lib/hbc/cli/fetch.rb
parent5c7c9de669025bbe4cad9829be39c5cf3b31ad25 (diff)
downloadbrew-e81f4ab7deeb40308f240be5ea00091fc8786d7a.tar.bz2
init
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/cli/fetch.rb')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/fetch.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/fetch.rb b/Library/Homebrew/cask/lib/hbc/cli/fetch.rb
new file mode 100644
index 000000000..647f2af2c
--- /dev/null
+++ b/Library/Homebrew/cask/lib/hbc/cli/fetch.rb
@@ -0,0 +1,19 @@
+class Hbc::CLI::Fetch < Hbc::CLI::Base
+ def self.run(*args)
+ cask_tokens = cask_tokens_from(args)
+ raise Hbc::CaskUnspecifiedError if cask_tokens.empty?
+ force = args.include? "--force"
+
+ cask_tokens.each do |cask_token|
+ ohai "Downloading external files for Cask #{cask_token}"
+ cask = Hbc.load(cask_token)
+ downloaded_path = Hbc::Download.new(cask, force: force).perform
+ Hbc::Verify.all(cask, downloaded_path)
+ ohai "Success! Downloaded to -> #{downloaded_path}"
+ end
+ end
+
+ def self.help
+ "downloads remote application files to local cache"
+ end
+end