Install Cask’s default tap if untapped.

This commit is contained in:
Markus Reiter 2016-08-20 07:02:23 +02:00
parent 7395ff2001
commit 0dd3203187
4 changed files with 3 additions and 3 deletions

View File

@ -142,6 +142,7 @@ class Hbc::CLI
command_string, *rest = *arguments
rest = process_options(rest)
command = Hbc.help ? "help" : lookup_command(command_string)
Hbc.default_tap.install unless Hbc.default_tap.installed?
Hbc.init if should_init?(command)
run_command(command, *rest)
rescue Hbc::CaskError, Hbc::CaskSha256MismatchError => e

View File

@ -126,7 +126,7 @@ module Hbc::Locations
attr_writer :default_tap
def default_tap
@default_tap ||= Tap.fetch("caskroom/homebrew-cask")
@default_tap ||= Tap.fetch("caskroom", "homebrew-cask")
end
def path(query)

View File

@ -17,7 +17,6 @@ OFFICIAL_TAPS = %w[
].freeze
OFFICIAL_CMD_TAPS = {
"caskroom/cask" => ["cask"],
"homebrew/bundle" => ["bundle"],
"homebrew/services" => ["services"],
}.freeze

View File

@ -307,7 +307,7 @@ class Tap
@formula_dir ||= [path/"Formula", path/"HomebrewFormula", path].detect(&:directory?)
end
# path to the directory of all casks for caskroom/cask {Tap}.
# path to the directory of all {Cask} files for this {Tap}.
def cask_dir
@cask_dir ||= path/"Casks"
end